如何告诉 systemd 启动的 uWSGI 守护进程使用特定的 python?
How to tell a systemd initiated uWSGI daemon to use a specific python?
我从在线示例中拼凑了以下 uWSGI 配置文件。
(◠﹏◠)
鉴于此配置 - 它驻留在 /etc/uwsgi.d/myapp.ini
中,用于启动 uwsgi
守护程序,然后通过 systemd/systemctl
myapp
- 这配置指令 是否用于告诉它为 myapp
使用特定的虚拟环境 PYTHON?
是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
# =======================================================
谢谢。
是的,签入这个linkhttp://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html
home = /path/to/virtualenv
希望对你有帮助
我从在线示例中拼凑了以下 uWSGI 配置文件。 (◠﹏◠)
鉴于此配置 - 它驻留在 /etc/uwsgi.d/myapp.ini
中,用于启动 uwsgi
守护程序,然后通过 systemd/systemctl
myapp
- 这配置指令 是否用于告诉它为 myapp
使用特定的虚拟环境 PYTHON?
是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
# =======================================================
谢谢。
是的,签入这个linkhttp://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html
home = /path/to/virtualenv
希望对你有帮助