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.
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