user1187968
user1187968

Reputation: 7986

Setup Django on Centos with Apache and mod_wsgi

I am having a hard time to setup mod_wsgi on centos, I am keep getting the following error:

403 Forbidden You don't have permission to access / on this server.

-----Sever Setup-----

Python Version: 2.6.6
Apache Version: 2.2.15
mod_wsgi: mod_wsgi-3.2-3.el6.x86_64

-----Apache Config "httpd.conf"-----

LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /home/prj1/prj1/wsgi.py
WSGIPythonPath /home/prj1
<Directory /home/prj1>
Order deny,allow
Allow from all
</Directory>

-----Django /home/prj1/prj1/wsgi.py-----

import os
import sys

sys.path.append('/home/prj1')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "prj1.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

Upvotes: 0

Views: 2348

Answers (2)

user1187968
user1187968

Reputation: 7986

A quick dirty solution to disable the SELinux

echo 0 > /selinux/enforce

Upvotes: 1

Serafeim
Serafeim

Reputation: 15084

This is not a good question for SO, but in any case: Does the user under which you run apache has access to the /home/prj1 directory ? Try doing

chmod 755 -R /home/prgj1 

as root.

Upvotes: 0

Related Questions