I am trying to deploy my project using mod_wsgi. Unfortunately I get:
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] Exception in WSGI handler:
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] Traceback (most recent call last):
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/home/project/project/wsgi/project.wsgi", line 26, in application
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] return handler(environ, start_response)
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/usr/lib/python2.5/site-packages/Django-1.2.1-py2.5.egg/django/core/handlers/wsgi.py", line 230, in __call__
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] self.load_middleware()
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/usr/lib/python2.5/site-packages/Django-1.2.1-py2.5.egg/django/core/handlers/base.py", line 33, in load_middleware
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] for middleware_path in settings.MIDDLEWARE_CLASSES:
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/usr/lib/python2.5/site-packages/Django-1.2.1-py2.5.egg/django/utils/functional.py", line 276, in __getattr__
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] self._setup()
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/usr/lib/python2.5/site-packages/Django-1.2.1-py2.5.egg/django/conf/__init__.py", line 40, in _setup
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] self._wrapped = Settings(settings_module)
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/usr/lib/python2.5/site-packages/Django-1.2.1-py2.5.egg/django/conf/__init__.py", line 73, in __init__
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] mod = importlib.import_module(self.SETTINGS_MODULE)
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/usr/lib/python2.5/site-packages/Django-1.2.1-py2.5.egg/django/utils/importlib.py", line 35, in import_module
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] __import__(name)
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/home/project/project/__init__.py", line 7, in <module>
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] logging.config.fileConfig(settings.LOG_CONFIG)
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/usr/lib/python2.5/logging/config.py", line 84, in fileConfig
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] handlers = _install_handlers(cp, formatters)
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/usr/lib/python2.5/logging/config.py", line 152, in _install_handlers
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] h = apply(klass, args)
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/usr/lib/python2.5/logging/handlers.py", line 109, in __init__
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] BaseRotatingHandler.__init__(self, filename, mode, encoding)
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/usr/lib/python2.5/logging/handlers.py", line 61, in __init__
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] logging.FileHandler.__init__(self, filename, mode, encoding)
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] File "/usr/lib/python2.5/logging/__init__.py", line 772, in __init__
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] stream = open(filename, mode)
[Wed Oct 27 15:32:33 2010] [error] [client 10.13.3.64] IOError: [Errno 13] Permission denied: 'project.log'
I have an entry for my project inside /etc/apache2/sites-enabled/:
SetEnv app_settings project.config.production
WSGIDaemonProcess project user=project group=project threads=1 processes=1 home=/home/project/project python-path=/home/project
<VirtualHost *>
ServerName project.internal
WSGIScriptAlias / /home/project/project/wsgi/project.wsgi
WSGIProcessGroup %{GLOBAL}
</VirtualHost>
My logs should be stored inside the project directory. I have investigated it a little and just before project.log is supposed to be opened I run os.getcwd(), which returned /
. Can anyone tell me, what I might have misconfigured that this happens?