簡體   English   中英

Python-卵緩存提取錯誤-權限被拒絕-Apache沒有看到SetEnv?

[英]Python - egg cache extraction error - permission denied - Apache not seeing SetEnv?

我正在嘗試使用mod_wsgi設置Apache以在Red Hat盒子上運行Django,但是我卻收到了可怕的“權限被拒絕:'/ home / pineg / .python-eggs'”雞蛋緩存提取錯誤。

我按照它所說的做,並使其成為第一行:

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.

mod_wsgi文檔中描述了此問題和解決方案,網址為:

http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Access_Rights_Of_Apache_User

我現在對Apa​​che-Django的細節一無所知,但總的來說

SetEnv PYTHON_EGG_CACHE /opt/tmp

沒有設置環境變量,它僅將其添加到environ字典中, index.wsgi哪個application(environ, start_response)函數應該接受。

哦,好吧,我沒有讓它愚弄,而是告訴Python不要將其安裝為愚蠢的雞蛋:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM