views:

79

answers:

2

I have a website I've built in django that I'm trying to get working on our corporate Apache server (on debian) for our intranet at my workplace. Unfortunately, Apache keeps returning server errors whenever I try to navigate to my site. Although I can navigate to the statics folder. My Apache config and wsgi script look like the following...

lbirdf.wsgi

import os
import sys

sys.path.append('/home/lbi/rdfweb/web')
sys.path.append('/home/lbi/rdfweb/web/lbirdf')

os.environ['DJANGO_SETTINGS_MODULE'] = 'lbirdf.settings_production'

import django.core.handlers.wsgi

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

Apache config

Listen 8080

<VirtualHost *:8080>
ServerName server1
WSGIScriptAlias /rdfweb /home/lbi/rdfweb/web/lbirdf/apache/lbirdf.wsgi
Alias /statics /home/lbi/rdfweb/web/lbirdf/statics
Alias /admin_media /home/lbi/rdfweb/web/lbirdf/admin_media

<Directory /home/lbi/rdfweb/web/lbirdf/apache>
Order allow,deny
Allow from all
</Directory>

<Directory /home/lbi/rdfweb/web/lbirdf/admin_media>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Any ideas on where I might be going wrong?

A: 

sys.path.append('/home/lbi/rdfweb/')

Telos
Thanks for the prompt response! Unfortunately, that was just a typo in the question. Due to some of our work security policies, I had to print the code and re-type.
notagain
A: 

What messages are in the Apache error log? Try setting DEBUG to true in Django settings file to get more informative error message sent back to browser in instance that it is an issue in your application.

Possible causes are, urls.py is wrong because you are erroneously including site prefix when you don't need to or a permissions issue because code running as Apache user and not you.

Not knowing the actual errors doesn't help in working out the problem.

Graham Dumpleton
It turned out to be a path problem in my settings file (due to some changes when putting into production), combined with an issue with PostgreSQL on Debian (psql permissions enforcing sameuser on Apache). Thanks for the reply.
notagain