大佬教程收集整理的这篇文章主要介绍了nginx – uWSGI权限问题,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试设置一个主厨配方,让我的网站运行,一切似乎都工作正常,除了uWsgi,它给了我以下错误:
*** has_emperor mode detected (fd: 6) ***
[uWsgi] getTing INI configuration from app-cms.ini
removed uwsgi instance app-cms.ini
不再这样说了:
open("/var/www/app-cms/logs/uwsgi.log"): Permission denied [utils.c @R_965_5450@6]
现在正在创建该日志文件,其中包含以下内容:
*** StarTing uWsgi 1.0.3-debian (64bit) on [Thu Feb 6 12:00:43 2014] ***
compiled with version: 4.6.3 on 17 July 2012 02:26:54
current working directory: /etc/uwsgi/apps-enabled
wriTing pidfile to /var/www/ediflo-cms/run/ediflo-cms.pid
detected binary path: /usr/bin/uwsgi-core
setgid() to 33
setuid() to 33
chdir(): Permission denied [uwsgi.c line 1723]
chdir(): Permission denied [uwsgi.c line 975]
我不确定它在尝试chdir()的位置.
我在emperor模式下启动uWsgi,并使用以下upstart配置文件使用/ etc / uwsgi / apps-enabled / fori文件:
description "uWsgi"
start on runlevel [2345]
stop on runlevel [06]
respawn
exec uwsgi --emperor /etc/uwsgi/apps-enabled --uid uwsgi --gid www-data --logto /var/log/uwsgi/uwsgi.log
这是我的uWsgi app配置:
[uwsgi]
; define variables to use in this script
; process name for easy identification in top
project = app-cms
base_dir = /var/www/app-cms
chdir = %(base_dir)
pythonpath = %(base_dir)/env/bin
uid = www-data
gid = www-data
procname = %(project)
; This value needs to be tuned
workers = 4
; Create pid file for easier process management
pidfile = %(base_dir)/run/%(project).pid
; Specify your app here
module = %(project)-wsgi:application
log-reopen = true
logto = %(base_dir)/logs/uwsgi.log
chmod-socket = 660
VACUUM = True
enable-threads = True
; unix socket
socket = /tmp/app-cms-server.sock
; Enable stats
stats = /tmp/app-cms-stats.sock
检查/var/www/app-cms/logs/uwsgi.log是否已存在且是否为root所有,很可能是先前尝试的结果,现在非特权进程无法在写入模式下访问它.
最后,不要将Emperor和vassal映射到同一个日志文件,它是隐含的,因为文件描述符2是继承的,如果vassal拥有与Emperor不同的权限,它可能会导致各种问题(不是你的情况)
以上是大佬教程为你收集整理的nginx – uWSGI权限问题全部内容,希望文章能够帮你解决nginx – uWSGI权限问题所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。