2017-10-06 46 views
0

我在網上的例子中拼湊了下面的uWSGI配置文件。 (◠﹏◠)如何告訴systemd啓動的uWSGI守護進程使用特定的python?

鑑於此配置 - 駐留在/etc/uwsgi.d/myapp.ini和被用於啓動uwsgi守護進程,反過來,通過myappsystemd/systemctl - 這配置指令做我用它告訴使用特定的虛擬環境PYTHON for myapp

是不是home =

換句話說,當它調用django.wsgi應用程序時,我該如何告訴它(或它是如何知道的):/home/myapp_unixHome/.virtualenvs/myapp/bin/python

[uwsgi] 

# ======================================================= 
# Directories ... 
# ======================================================= 
home  = /home/myapp_unixHome/.virtualenvs/myapp/ <--- Python virtualenv dir. 
chdir  = /home/myapp_unixHome/myapp/    <--- Django App here. 
wsgi-file = /home/myapp_unixHome/myapp/django.wsgi <--- Including this django.wsgi file. 
static-map = /m=/home/myapp_unixHome/myapp/static/  <--- Static files. 
# ======================================================= 

# ======================================================= 
# TO BE NAMED ... 
# ======================================================= 
master = true 
processes = 5 
# ======================================================= 

# ======================================================= 
# myapp communicates w/ nginx via a UNIX domain socket. 
# ======================================================= 
socket  = /run/uwsgi/myapp.sock 
chmod-socket = 664 
uid   = nginx 
gid   = nginx 
vacuum  = true 
# ======================================================= 

# ======================================================= 
# uWSGI Log file. 
# ======================================================= 
logto = /var/log/uwsgi.log 
# ======================================================= 

謝謝。

回答