Gunicorn和Supervisor错误文件没有可执行权限
我正在尝试运行这个命令:
sudo supervisorctl start gunicorn_process
在Ubuntu系统上,但我遇到了这个错误:
如你所见,这个文件确实有可执行的权限。
gunicorn_process 文件:
[program:gunicorn_process]
command=/srv/domain wsgi:application
directory=/srv/domain
user=root
2 个回答
3
让这个文件可以执行:sudo chmod u+x gunicorn_process
5
这个 command
指令需要一个可执行的命令,Supervisor 会去运行它。
你说你想要运行
gunicorn wsgi:application
那么你可以这样设置你的配置:
[program:gunicorn_process]
command=gunicorn wsgi:application
directory=/srv/domain
user=root
有两点需要注意:
你不应该以 root 用户身份运行你的 wsgi 应用。这会有潜在的安全问题。你应该创建一个没有额外权限的用户,专门用来运行你的网页应用和服务器。
你可能需要把
command
指令改成包含gunicorn
可执行文件的完整路径。可以用which gunicorn
来查找它的位置。例如:command=/usr/bin/gunicorn wsgi:application