2014-09-26 64 views

回答

0

你可以把你想要的uWSGI配置文件中沒有這樣的文件夾。該路徑不是硬編碼的。你看到的主要是分發包的約定或系統管理員的口味。

+0

但它怎麼然後讀? – Christoffer 2014-09-26 15:09:21

+0

閱讀文檔:https://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html問這個問題之前,這裏 – roberto 2014-09-26 15:22:09

+0

多次閱讀。如果您已經知道文檔的內容,文檔纔有意義。 – Christoffer 2014-09-29 14:54:28

0

沒有uwsgi.conf文件自動生成。所以你必須創建你自己的。

看來你必須在本地安裝uwsgi兩者(在virtualenv中)和全球。然後創建一個uwsgi_my_app.conf文件並將其放入/ etc/init文件夾中。此文件應包含:

description "uwsgi my_app instance" 
start on runlevel [2345] 
stop on runlevel [06] 

exec uwsgi --ini /etc/uwsgi/apps-enabled/my_app.ini 

然後做出my_app.ini文件/ etc/uwsgi /啓用應用程序,(你也必須創建這個目錄),你uwsgi設置。例如:

[uwsgi] 
uid = www-data 
gid = www-data 

# the virtualenv (full path) 
virtualenv = path/to/venv 
# Project path 
chdir = path/to/my_app 
# Django's wsgi file (path starting from chdir/) 
wsgi-file = my_app/wsgi.py 

# the socket (use the full path to be safe) 
socket = /tmp/uwsgi.sock 
# ... with appropriate permissions 
chmod-socket = 664 

logto = path/to/logs/uwsgi.log 

enable-threads = true 
single-interpreter = true 
thunder-lock = true 
die-on-term = true 
master = true 

threads = 5 
processes = 2 
max-requests = 1000 
buffer-size = 32768 
post-buffering = 8192 

# clear environment on exit 
vacuum = true 

現在你可以開始/停止/重啓uwsgi有:

sudo service start uwsgi_my_app 
相關問題