Take the 2-minute tour ×

Hello I had to recently reinstall mod_wsgi today (As our Red Hat server was curupted again). Something funny happed while deployiing with Django. I kept on getting page 403 errors You do not have permission to access /mmc on this server error.

My project folder is stored in /usr/local/src/djcode/c2duo_mms' The permission of my project folder and all of its contents are set tochmod 755`. The app name is called mmc.

django.wsgi file

import os 
import sys  


os.environ['DJANGO_SETTINGS_MODULE'] = 'c2duo_mms.settings' 
import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandle()  

httpd.conf file

WSGIScriptAlias /mmc /usr/local/src/djcode/c2duo_mms/apache/django.wsgi
WSGIPythonEggs /tmp 
<Directory /var/www/html/c2duo_crm/apache> 
Order allow,deny 

Allow from all 

I can't see what the problem is here. I had my project folder stored in the same place as last time, but this time it is not working.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

It isn't just the specific folder the WSGI script file is in that needs to be accessible by Apache user. All the directories back up to the root of the file system need to also be searchable by Apache user. That if parent directories have restrictive permission you will get that error. For some more details watch:


which covers details of permissions.


The obvous mistake in your configuration which I missed is that you should be using:

<Directory /usr/local/src/djcode/c2duo_mms/apache>

and NOT:


I got distracted by you talking about permissions and just correct what you were saying when actually not relevant.

Go look again at examples in mod_wsgi which show how WSGIScriptAlias and the Directory directive relate.

share|improve this answer
@Graham Here are my permission for each parent folder. usr: drwxr-xr-x 14 root root, local: drwxr-xr-x 11 root root, src: drwxr-xr-x 3 root root`, djcode: drwxr-xr-x 7 sh sh. Seems fine. Oh - and if I was to move my djcode folder to /var/www/html, it will work. It may have something to do with what is written in the httpd.conf file DocumentRoot "/var/www/html/". I did tried to change the DocumentRoot directory to /usr/local/src/djcode/, but it said "syntax error", "DocumentRoot must be a directory". –  Shehzad009 Jun 7 '11 at 8:54
add comment

Make sure that the permissions on your WSGI sockets are such that your effective user has read/write access?

Relevant Documentation: http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGISocketPrefix

If that doesn't help, are your configs recovered from backups, or were they completely re-written? Can you provide more of your configuration?

share|improve this answer
That will not cause that problem. Apache runs up as root initially and ensures sockets, which are only created at that point, have all the right ownership and permissions. The directory itself does though need to be accessible by Apache user. –  Graham Dumpleton Jun 7 '11 at 1:18
add comment

Your Answer


