Django目录权限配置问题
我在 error.log 中收到以下内容:
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1] [Errno 13] Permission denied: '/Dropbox/project/www/mod_wsgi/egg-cache'
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1]
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1] The Python egg cache directory is currently set to:
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1]
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1] /Dropbox/project/www/mod_wsgi/egg-cache
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1]
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1] Perhaps your account does not have write access to this directory? You can
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1] change the cache directory by setting the PYTHON_EGG_CACHE environment
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1] variable to point to an accessible directory.
我应该设置什么以及如何设置?
更新:
当前权限:
drwxr-xr-x 4 petarpetrov admin 136 Apr 30 13:38 mod_wsgi
此外,由于某种原因,Apache 的用户和组似乎都是 _www
I get in my error.log the following:
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1] [Errno 13] Permission denied: '/Dropbox/project/www/mod_wsgi/egg-cache'
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1]
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1] The Python egg cache directory is currently set to:
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1]
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1] /Dropbox/project/www/mod_wsgi/egg-cache
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1]
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1] Perhaps your account does not have write access to this directory? You can
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1] change the cache directory by setting the PYTHON_EGG_CACHE environment
[Tue May 03 16:42:21 2011] [error] [client 127.0.0.1] variable to point to an accessible directory.
what and how should i set it up?
UPDATE:
permissions currently:
drwxr-xr-x 4 petarpetrov admin 136 Apr 30 13:38 mod_wsgi
Also, both User and Group of Apache both seem to be _www
for some reason
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了在目录中创建文件,运行的用户 Apache 需要对其具有写入权限。目前,Apache 正在以
_www
组中的_www
用户身份运行,而petarpetrov
拥有该目录,并且是唯一允许写入该目录的用户。为了允许
_www
写入该目录,您应该将拥有该目录的组更改为_www
并更改目录权限:这应该将组所有权更改为
_www
并允许该组写入该目录。根据该目录中的内容,可能需要更多权限。In order to create files in a directory, the user Apache is running as needs to have write permissions to it. Currently Apache is running as
_www
user in the_www
group, whilepetarpetrov
owns the directory and is the only one allowed to write to it.In order to allow
_www
to write to that directory you should change the group which owns it to_www
and change the directory permissions:This should change the group ownership to
_www
and allow that group to write to that directory. Depending on what goes into that directory, more permissions may be required.