【发布时间】:2016-01-23 00:31:40
【问题描述】:
我在 Ubuntu 13.04 服务器上设置了一个基于 django 的项目。 我可以在 uWSGI 配置文件上使用“root”权限运行这个项目。 但是当我尝试使用标准的“www-data”用户运行它时,我得到了:
chdir(): Permission denied [uwsgi.c line 1851]
我已将我的项目及其相应 virtualenv 文件夹的所有权更改为“www-data”,但再次出现此错误!
我的 uWSGI 配置文件是这样的:
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /root/my_project
# Django's wsgi file
module = my_project.wsgi
# the virtualenv (full path)
home = /root/.virtualenvs/my_project
# process-related settings
# master
master = true
# maximum number of worker processes
processes = 10
# the socket (use the full path to be safe
socket = unix:///root/my_project/server.uwsgi.sock
chmod-socket = 666
uid = www-data
gid = www-data
# clear environment on exit
vacuum = true
怎么了?
【问题讨论】:
-
该目录
chown'd 是否由其他用户提供? -
不!亲爱的@AaronLelevier。我带来的 uWSGI 文件中提到的所有文件夹都是由用户
www-data编辑的chown'ed,该用户属于组www-data
标签: django virtualenv uwsgi virtualenvwrapper