我似乎有与mod_wsgi部署django的问题。 在过去,我使用mod_python,但我想进行更改。 我一直在使用Graham Dumpleton在这里注意到http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango 1 ,但它似乎仍然不起作用。 我得到一个内部服务器错误。
django.wsgi file:
import os import sys sys.path.append('/var/www/html') sys.path.append('/var/www/html/c2duo_crm') os.environ['DJANGO_SETTINGS_MODULE'] = 'c2duo_crm.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() WSGIScriptAlias / /var/www/html/c2duo_crm/apache/django.wsgi
Apache httpd file:
<Directory /var/www/html/c2duo_crm/apache> Order allow,deny Allow from all </Directory>
在我的apache错误日志中,它说我有这个错误这不是全部,但是我有最重要的部分:
[Errno 13] Permission denied: '/.python-eggs' [Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] [Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] The Python egg cache directory is currently set to: [Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] [Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] /.python-eggs [Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] [Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] Perhaps your account does not have write access to this directory? You can [Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] change the cache directory by setting the PYTHON_EGG_CACHE environment [Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] variable to point to an accessible directory.
您可以为此设置WSGIvariables。 在你的Apacheconfiguration中:
WSGIPythonEggs /var/tmp
这与设置PYTHON_EGG_CACHE环境variables相同,正如topdog的答案中所指出的那样,它只适用于mod_python。
在你的apacheconfiguration中设置
SetEnv PYTHON_EGG_CACHE /var/tmp