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

We're hosting two sites and don't have a domain name at the moment so we're using the IP address. I want the two sites to be accessed in the following manner:

Site1 is a small About us type site. Site2 is a Django-based file upload site.

Here's my httpd.conf file:

WSGIPythonPath /var/www/Site2/src/site
Listen 80
NameVirtualHost *:80

# Site1
<VirtualHost *:80>
    ServerName Site1
    DocumentRoot /var/www/Site1

# Site2
<VirtualHost *:80>
    ServerName Site2

    WSGIScriptAlias /Site2 /var/www/Site2/src/site/

    <Directory /var/www/Site2/src/site>
            Order deny,allow
            Allow from all

    Alias /static/ /var/www/Site2/src/site/static/

    <Directory /var/www/Site2/src/site/static>
        Order deny,allow
        Allow from all

    <Location /var/www/Site2/src/site/static/>
        AuthType Basic
        AuthName "site"
        AuthBasicProvider wsgi
        WSGIAuthUserScript /usr/local/wsgi/scripts/auth.wsgi
        Require valid-user
</VirtualHost> works fine. Visiting only yields the Index of /Site2 page.

If I re-order the VirtualHost declarations then Site2 works, but Site1 does not.

Am I missing something incredibly crucial?

I've seen this problem crop up on a number of search results and forums but I haven't yet found a solution.

share|improve this question
Possible duplicate of… – trpt4him Jan 8 '13 at 17:38
That fixed my problem! Should this be closed or answered and accepted? – circuitBurn Jan 8 '13 at 18:01
Not sure.. can't flag it since the answer is on Stack Overflow. I'll post below. – trpt4him Jan 8 '13 at 21:15
up vote 0 down vote accepted

What you need is to use an Alias directive instead of a virtual host, since you're dealing with a single domain.

See the accepted answer to this post:

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.