Python - Egg 缓存提取错误 - 权限被拒绝 - Apache 没有看到 SetEnv?

发布于 2024-11-06 00:02:15 字数 1522 浏览 0 评论 0原文

我正在尝试使用 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 技术交流群。

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

发布评论

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

评论(3

刘备忘录 2024-11-13 00:02:15

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

叹梦 2024-11-13 00:02:15

我现在对 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, which application(environ, start_response) function in index.wsgi should accept.

自演自醉 2024-11-13 00:02:15

哦,好吧,我没有愚弄它,而是告诉 Python 不要将它安装为一个愚蠢的鸡蛋:

>sudo python setup.py install --single-version-externally-managed --record=/opt/python/source/weird_egg_thing

Oh well, instead of fooling with that, I told Python to not install it as a stupid egg:

>sudo python setup.py install --single-version-externally-managed --record=/opt/python/source/weird_egg_thing
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文