Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have got Ubuntu 10.04 (XEN) VPS. I want to set up Django server. I use apt-get to install django packages, apache, apache-mpm-prefork. Before using this configuration I saw "It works!" title, when I use ip/domain to get access to the server. After using configuration I saw:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request. 

I found my django folder in this directory: /usr/local/lib/python2.7/dist-packages/django/ , while using find command to '' (also, such file at /usr/local/bin) and put there folder from my development computer. So, this is my configuration:

<Location "/">
  SetHandler python-program
  PythonHandler django.core.handlers.modpython
  SetEnv DJANGO_SETTINGS_MODULE projectname.settings
  PythonDebug Off
  PythonAutoReload Off
  PythonPath "['/usr/local/lib/python2.7/dist-packages/django','/usr/local/lib/python2.7/sidt-packages/django/bin/projectname'] + sys.path"

<Location "/media/">
  SetHandler None

<Location "/static/">
  SetHandler None

What is wrong with my configuration? And how can I found information about errors, I can't understand what I must search to fix.

share|improve this question
Check the Apache error log, which should be in /var/log/apache2/error.log - that 500 error should be logging errors in that file. Edit your question with interesting lines. – Shane Madden Aug 15 '11 at 20:25
I thought python and mod_python debug isn't same thing. I enable it and got import error. – Dracontis Aug 15 '11 at 20:29
Fixed import error. Got 'template does not exist'. Also, I can get access to static files. – Dracontis Aug 15 '11 at 20:43
up vote 1 down vote accepted

Where's the Django project located? You'll need to point your PythonPath at the project, not necessarily the Django library files.

It's configured to look in /usr/local/lib/python2.7/sidt-packages/django/bin/projectname; that should be "site-packages" instead, but confirm that that's where the project files are located (is "projectname" correct?).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.