I want to deploy my Django project on my apache server but even if I follow django's example in deploying with apache I get a 403 Error. I am using:
- django 1.6
- apache 2.4.7
- python 2.6.x
My wsgi.py is the one created by django-admin startproject
import os, sys
#root = os.path.join(os.path.dirname(__file__),'..')
# sys.path.insert(0, root)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rhombus.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
My VirutalServer conf file is the following
rhombus.conf
WSGIPythonPath /var/www/rhombus2
<VirtualHost *:80>
ServerAdmin webmast@rhombus.com
ServerName myrhombus.com
ServerAlias www.myrhombus.com
DocumentRoot /var/www/rhombus2
WSGIScriptAlias / /var/www/rhombus2/rhombus/wsgi.py
<Directory /var/www/rhombus2/rhombus>
<Files wsgi.py>
Require all granted
</Files>
Options Indexes FollowSymLinks
Require all granted
</Directory>
</VirtualHost>
and I have placed rhombus2 inside /var/www. All foldters and files are at 755 with sudo chmod -R 755 /var/www/rhombus2
. But even with that I get a Forbidden Error.
Among other things, when I remove the WSGIPythonPath, I don't get Import Error, which I probably should. I know it is not the secure way to have everything (code too) under document root. But I really need to have it working first, and then make it secure. Is there something wrong with my code?
EDIT: error.log
(13)Permission denied: [client 127.0.0.1:46669] AH00035: access to /favicon.ico denied (filesystem path '/home/avlahop/development/django') because search permissions are missing on a component of the path
Not sure why it's showing me this path, cause there isn't it anywhere in my rhombus.conf.
EDIT2: I also don't have any other site enabled. My hosts file has the following line
127.0.0.1 www.myrhombus.com