我正在按照这篇教程进行操作:https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-14-04。我相信我的设置没有问题。/var/log/nginx/error.log文件中有很多以下错误信息:
2015/12/19 18:41:58 [crit] 10850#0: *23 连接到unix:/home/root/myproject/myproject.sock失败(13: Permission denied),在连接上游时,客户端:[[my ip]],服务器:[[server ip]],请求:"GET / HTTP/1.1",上游:"http://unix:/home/root/myproject/myproject.sock:/",主机:"[[server ip]]"
命令如下:
2015/12/19 18:41:58 [crit] 10850#0: *23 连接到unix:/home/root/myproject/myproject.sock失败(13: Permission denied),在连接上游时,客户端:[[my ip]],服务器:[[server ip]],请求:"GET / HTTP/1.1",上游:"http://unix:/home/root/myproject/myproject.sock:/",主机:"[[server ip]]"
命令如下:
/home/root/myproject ls -l /home/root/classNote/classNote.sock
输出:
srwxrwxrwx 1 root www-data 0 Dec 19 18:17 /home/root/myproject/myproject.sock
编辑:Andrei的评论回复:
命令:
ps ax | grep gunicorn
输出:
847 ? Ss 0:00 /home/root/myproject/myprojectEnv/bin/python myprojectEnv/bin/gunicorn --workers 3 --bind unix:/home/root/myproject/myproject.sock myproject.wsgi:application
921 ? S 0:00 /home/root/myproject/myprojectEnv/bin/python myprojectEnv/bin/gunicorn --workers 3 --bind unix:/home/root/myproject/myproject.sock myproject.wsgi:application
923 ? S 0:00 /home/root/myproject/myprojectEnv/bin/python myprojectEnv/bin/gunicorn --workers 3 --bind unix:/home/root/myproject/myproject.sock myproject.wsgi:application
928 ? S 0:00 /home/root/myproject/myprojectEnv/bin/python myprojectEnv/bin/gunicorn --workers 3 --bind unix:/home/root/myproject/myproject.sock myproject.wsgi:application
1136 pts/0 S+ 0:00 grep gunicorn
~
。运行以下命令:chmod o+rx .
- undefined