Django目录权限配置问题

发布于 2024-11-04 13:15:25 字数 1106 浏览 0 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

や三分注定 2024-11-11 13:15:25

为了在目录中创建文件,运行的用户 Apache 需要对其具有写入权限。目前,Apache 正在以 _www 组中的 _www 用户身份运行,而 petarpetrov 拥有该目录,并且是唯一允许写入该目录的用户。

为了允许 _www 写入该目录,您应该将拥有该目录的组更改为 _www 并更改目录权限:

chgrp _www /Dropbox/touchsofia/www/mod_wsgi/egg-cache
chmod g+w /Dropbox/touchsofia/www/mod_wsgi/egg-cache

这应该将组所有权更改为 _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, while petarpetrov 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:

chgrp _www /Dropbox/touchsofia/www/mod_wsgi/egg-cache
chmod g+w /Dropbox/touchsofia/www/mod_wsgi/egg-cache

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文