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/wsgi.py

    <Directory /var/www/Site2/src/site>
        <Files wsgi.py>
            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.


1 Answer 1


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:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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