大佬教程收集整理的这篇文章主要介绍了python – 连接到上游时的Nginx,django,gunicorn,ubuntu 14.04(13:权限被拒绝),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用Nginx和gunicorn在我的django项目上工作,正如它在这里所说:
@R_696_10107@s://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-POSTGRes-nginx-and-gunicorn-on-ubuntu-14-04
我的网站在本地工作,但是当我启动Nginx和gunicorn服务器时
操作系统是UBUNTU 14.04
我正在尝试让我的项目工作,并以root身份重新安装所有内容(我知道它很糟糕) – 同样的错误.
这是我的“error.log”:
当我运行命令“Nginx”时:
Nginx: [emerg] bind() to 0.0.0.0:80 Failed (98: Address already in usE)
Nginx: [emerg] bind() to 0.0.0.0:80 Failed (98: Address already in usE)
Nginx: [emerg] bind() to 0.0.0.0:80 Failed (98: Address already in usE)
Nginx: [emerg] bind() to 0.0.0.0:80 Failed (98: Address already in usE)
Nginx: [emerg] bind() to 0.0.0.0:80 Failed (98: Address already in usE)
Nginx: [emerg] still Could not bind()
我的gunicorn.conf
描述“处理myproject的Gunicorn应用服务器”
从运行级别开始[2345]
停在运行级别[!2345]
重生
setuid root
setgid www-data
chdir / root / myproject
exec myprojectenv / bin / gunicorn –workers 3 –bind unix:/root/myproject/myproject.sock myproject.wsgi:application
多数民众赞成我的“/ etc / Nginx / sites-available / myproject”
server {
listen 80;
server_name www.mysite.ru;
error_log /Nginx_error.log;
LOCATIOn = /favicon.ico { access_log off; log_not_found off; }
LOCATIOn /static/ {
root /root/myproject;
}
LOCATIOn / {
include proxy_params;
proxy_pass @R_696_10107@://unix:/root/myproject/myproject.sock;
}
}
我非常感谢你的帮助!
解决方法:
proxy_pass @R_696_10107@://unix:/root/myproject/myproject.sock;
套接字位于超级用户的主文件夹中.对于包括你的Nginx用户在内的所有其他用户来说,这几乎是无法访问的.请将插座更多地连接到其他位置. / var / log / gunicorn /是个好地方.
我也看到你以root身份运行gunicorn吗?不建议.
setuid root
请在这里使用其他用户.
以上是大佬教程为你收集整理的python – 连接到上游时的Nginx,django,gunicorn,ubuntu 14.04(13:权限被拒绝)全部内容,希望文章能够帮你解决python – 连接到上游时的Nginx,django,gunicorn,ubuntu 14.04(13:权限被拒绝)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。