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've been trying to teach myself to create and deploy Django apps. I've created a test project and I can browse it using the Django test server. Now I want to deploy it using apache and mod_wsgi.

I followed the installation instructions at the Quick Installation Guide and got mod_wsgi installed. I then went through the example in the Quick Configuration Guide and was able to successfully connect to the example output in my browser.

I've now moved on to the Integration With Django ( section and I can't make any progress with it. Any time I try to browse to the URL I've set up for my project I am instead presented with the output from the example I created with the configuration guide. I've looked at the apache error log and there are no messages in it (I got a few when I was debugging the first example so I know I'm looking at the correct log). I even set 'LogLevel info' to try and get more detail in the logs, but there was none.

Does anyone have any suggestions?

Here is my apach2.conf:

LockFile ${APACHE_LOCK_DIR}/accept.lock
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
<IfModule mpm_event_module>
    StartServers          2
    MaxClients          150
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxRequestsPerChild   0
AccessFileName .htaccess
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy all
DefaultType text/plain
HostnameLookups Off  [3]: 

ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
Include mods-enabled/*.load
Include mods-enabled/*.conf
Include httpd.conf
Include ports.conf
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
Include conf.d/
Include sites-enabled/

Here is my httpd.conf:

ServerName HomeServer
LoadModule wsgi_module /usr/lib/apache2/modules/

Here is the VitualHost:

<VirtualHost *:80>
    ServerName ppbase.homeserver

    DocumentRoot /var/projects/ppbase/ppbase
    <Directory /var/projects/ppbase/ppbase>
        Order allow,deny
        Allow from all

    LogLevel info

    WSGIScriptAlias / /var/projects/ppbase/django.wsgi
    <Directory /var/projects/ppbase>
        Order allow,deny
        Allow from all

And here is the django.wsgi:

import os
import sys

projectpath = '/var/projects/ppbase'
projectapppath = '/var/projects/ppbase/ppbase'
if projectpath not in sys.path:
if projectapppath not in sys.path:
os.environ['DJANGO_SETTINGS_MODULE'] = 'ppbase.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()
share|improve this question
Forget it. I was being a total idiot. I'd set up my vhost file, but I hadn't enabled it in apache. – hellsgate May 7 '11 at 15:25

Make sure to enable your vhost file in apache.

share|improve this answer
Cheers Bassett :-) – hellsgate Dec 8 '11 at 15:15

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.