Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 'django-admin.py' (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>

<Location "/media/">
  SetHandler None
</Location>

<Location "/static/">
  SetHandler None
</Location>

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. –  Art Aug 15 '11 at 20:29
    
Fixed import error. Got 'template does not exist'. Also, I can get access to static files. –  Art Aug 15 '11 at 20:43
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.