我想用nginx和uWSGI在Ubunut 16.04上部署Flask应用程序,但每当我使用sudo systemctl start nebulon时,我没有收到错误,但状态显示如下:
nebulon.service - uWSGI instance to serve nebulon
Loaded: loaded (/etc/systemd/system/nebulon.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2017-09-16 18:08:35 UTC; 5s ago
Process: 18718 ExecStart=/nebulonapp/nebulon.sock --ini /nebulonapp/nebulon.ini (code=exited, status=203/EXEC)
Main PID: 18718 (code=exited, status=203/EXEC)
在星云服务公司名称:
^{pr2}$在/nebulonapp
我有星云.ini公司名称:
[uwsgi]
chdir=/nebulonapp/
wsgi-file = wsgi.py
callable = app
plugin=python35
master = true
processes = 5
socket = nebulon.sock
chmod-socket = 666
vacuum = true
die-on-term = true
nebulon.sock
在/nebulonapp
中,但它是空的。uWSGI的状态如下:
uwsgi.service - LSB: Start/stop uWSGI server instance(s)
Loaded: loaded (/etc/init.d/uwsgi; bad; vendor preset: enabled)
Active: active (exited) since Sat 2017-09-16 18:22:53 UTC; 10s ago
Docs: man:systemd-sysv-generator(8)
Process: 18828 ExecStop=/etc/init.d/uwsgi stop (code=exited, status=0/SUCCESS)
Process: 18854 ExecStart=/etc/init.d/uwsgi start (code=exited, status=0/SUCCESS)
Sep 16 18:22:53 nebulon systemd[1]: Stopped LSB: Start/stop uWSGI server instance(s).
Sep 16 18:22:53 nebulon systemd[1]: Starting LSB: Start/stop uWSGI server instance(s)...
Sep 16 18:22:53 nebulon uwsgi[18854]: * Starting app server(s) uwsgi
Sep 16 18:22:53 nebulon uwsgi[18854]: ...done.
Sep 16 18:22:53 nebulon systemd[1]: Started LSB: Start/stop uWSGI server instance(s).
不过,用下面的命令测试uWSGI是可行的。在
uwsgi --socket 0.0.0.0:5000 --plugin-python3 --protocol=http -w wsgi:app
谢谢你的帮助。在
问题在于权限。您正在遵循的digital ocean指南缺少一个关键步骤—nginx使用www数据组创建套接字,因此您需要将项目文件夹的所有权授予该组,并确保与您一起执行的用户也是其中的一部分。在
只需运行这两个命令
chown -R sammy:www-data /home/sammy/<project>/*
usermod -aG www-data sammy
相关问题 更多 >
编程相关推荐