Python - Egg 缓存提取错误 - 权限被拒绝 - Apache 没有看到 SetEnv?
我正在尝试使用 mod_wsgi 设置 Apache 以在 Red Hat 机器上运行 Django,但我收到了可怕的“权限被拒绝:'/home/pineg/.python-eggs'”egg 缓存提取错误。
我按照它所说的做了并将其作为第一行:
SetEnv PYTHON_EGG_CACHE /opt/tmp
在 /etc/httpd/conf/httpd.conf 中
并重新启动 Apache:
>sudo /etc/init.d/httpd restart
但我仍然遇到相同的错误(如下)。这几乎就像 Apache 忽略了我的 SetEnv。
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] The following error occurred while trying to extract file(s) to the Python egg
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] cache:
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561]
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] [Errno 13] Permission denied: '/home/pineg/.python-eggs'
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561]
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] The Python egg cache directory is currently set to:
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561]
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] /home/pineg/.python-eggs
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561]
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] Perhaps your account does not have write access to this directory? You can
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] change the cache directory by setting the PYTHON_EGG_CACHE environment
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] variable to point to an accessible directory.
I'm trying to set up Apache with mod_wsgi to run Django on a Red Hat box but I'm getting the dreaded "Permission denied: '/home/pineg/.python-eggs'" egg cache extraction error.
I did what it said and made this the first line:
SetEnv PYTHON_EGG_CACHE /opt/tmp
in /etc/httpd/conf/httpd.conf
And restarted Apache:
>sudo /etc/init.d/httpd restart
But I'm still getting the same error (below). It's almost like Apache is ignoring my SetEnv.
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] The following error occurred while trying to extract file(s) to the Python egg
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] cache:
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561]
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] [Errno 13] Permission denied: '/home/pineg/.python-eggs'
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561]
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] The Python egg cache directory is currently set to:
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561]
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] /home/pineg/.python-eggs
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561]
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] Perhaps your account does not have write access to this directory? You can
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] change the cache directory by setting the PYTHON_EGG_CACHE environment
[Fri May 06 10:08:37 2011] [error] [client 10.101.11.561] variable to point to an accessible directory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
mod_wsgi 文档中描述了此问题和解决方案:
http://code.google .com/p/modwsgi/wiki/ApplicationIssues#Access_Rights_Of_Apache_User
This issue and the solution is described in mod_wsgi documentation at:
http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Access_Rights_Of_Apache_User
我现在对 Apache-Django 的细节一无所知,但一般来说
SetEnv PYTHON_EGG_CACHE /opt/tmp
不会设置环境变量,它只将其添加到
environ
字典中,其中
函数应该接受。index.wsgi
中的 application(environ, start_response)I now nothing about Apache-Django specifics, but in general
SetEnv PYTHON_EGG_CACHE /opt/tmp
does not set environment variable, it only add it to
environ
dict, whichapplication(environ, start_response)
function inindex.wsgi
should accept.哦,好吧,我没有愚弄它,而是告诉 Python 不要将它安装为一个愚蠢的鸡蛋:
Oh well, instead of fooling with that, I told Python to not install it as a stupid egg: