Permission issue for apache

Posted by Aamir Adnan on Server Fault See other posts from Server Fault or by Aamir Adnan
Published on 2012-10-23T16:51:28Z Indexed on 2012/10/23 17:04 UTC
Read the original article Hit count: 276

Filed under:
|
|
|
|

Environment Details:

Amazon Ec2 Ubuntu 12.04
Django + mod_wsgi + python 2.6
web server: apache2

I have mounted a 10GB ebs volume to an instance to /mnt/ebs1/. After mounting the volume and formatting, I have placed all my project files in /mnt/ebs1/project. the wsgi file is in /mnt/ebs1/project/apache/django.wsgi. The content of wsgi file is:

import os, sys

sys.path.insert(0, '/mnt/ebs1/project')
sys.path.insert(1, '/mnt/ebs1')

os.environ['DJANGO_SETTINGS_MODULE'] = 'project.configs.common.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

My httpd.conf file looks as:

LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
WSGIPythonHome /usr/bin/python2.6

WSGIScriptAlias / /mnt/ebs1/project/apache/django.wsgi

<Directory /mnt/ebs1/project>
Order allow,deny
Allow from all
</Directory>

<Directory /mnt/ebs1/project/apache>
Order allow,deny
Allow from all
</Directory>

Alias /static/ /mnt/ebs1/project/static/
<Directory /mnt/ebs1/project/static>
Order deny,allow
Allow from all
</Directory>

The above configurations gives me Forbidden: You don't have permission to access / on this server.

I tried to find the user which is running apache using ps aux which is www-data and has group www-data. I have tried to change the ownership of /mnt/ebs1 and its subdirectories using chown -R www-data:www-data /mnt/ebs1 but that still does not solve the problem. Can any one tell me what I am doing wrong or have missed?

© Server Fault or respective owner

Related posts about linux

Related posts about apache2