{"id":5283,"date":"2017-08-17T15:35:10","date_gmt":"2017-08-17T12:35:10","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=5283"},"modified":"2021-09-10T18:00:21","modified_gmt":"2021-09-10T15:00:21","slug":"uwsgi-debian","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=5283","title":{"rendered":"uwsgi debian"},"content":{"rendered":"<p><code># apt-get install&nbsp;uwsgi-plugin-python&nbsp;uwsgi&nbsp;uwsgi-core<\/code><\/p>\n<p>nginx.conf:<\/p>\n<pre>...\nupstream graphite {\n        server unix:\/tmp\/graphite.sock;\n}\n...\n        location \/ {\n                uwsgi_pass graphite;\n                include uwsgi_params;           \n        }\n...\n<\/pre>\n<p><!--more--><\/p>\n<p><code>[uwsgi]<br \/>\nvacuum = true<br \/>\nmaster = true<br \/>\nprocesses = 8<br \/>\nchmod-socket = 666<br \/>\nbuffer-size = 65536<br \/>\nsocket = \/tmp\/graphite.sock<br \/>\ngid = _graphite<br \/>\nuid = _graphite<br \/>\nwsgi-file = \/usr\/share\/graphite-web\/graphite.wsgi<br \/>\ndisable-logging = True<\/code><\/p>\n<p>\/usr\/share\/graphite-web\/graphite.wsgi<\/p>\n<pre>import os, sys\nimport django\nos.environ['DJANGO_SETTINGS_MODULE'] = 'graphite.settings'\nif django.get_version() &gt;= \"1.7\":\n        django.setup()\n\nimport django.core.handlers.wsgi\n\napplication = django.core.handlers.wsgi.WSGIHandler()\n\n# READ THIS\n# Initializing the search index can be very expensive, please include\n# the WSGIScriptImport directive pointing to this script in your vhost\n# config to ensure the index is preloaded before any requests are handed\n# to the process.\nfrom graphite.logger import log\nlog.info(\"graphite.wsgi - pid %d - reloading search index\" % os.getpid())\nimport graphite.metrics.search\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p># apt-get install&nbsp;uwsgi-plugin-python&nbsp;uwsgi&nbsp;uwsgi-core nginx.conf: &#8230; upstream graphite { server unix:\/tmp\/graphite.sock; } &#8230; location \/ { uwsgi_pass graphite; include uwsgi_params; } &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-5283","post","type-post","status-publish","format-standard","hentry","category-others"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5283"}],"version-history":[{"count":3,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5283\/revisions"}],"predecessor-version":[{"id":5772,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5283\/revisions\/5772"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}