Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm trying to get 2 separate django projects running on the same apache server with mod_wsgi that are also under the same domain but different urls. Like www.example.com/site1/ and www.example.com/site2

What I'm trying to do is something like...

<VirtualHost *:80>
    ServerName www.example.com

    <location "/site1/">
        DocumentRoot "/var/www/html/site1"
        WSGIScriptAlias / /var/www/html/site1/django.wsgi
    </location>

    <location "/site2/">
        DocumentRoot "/var/www/html/site2"
        WSGIScriptAlias / /var/www/html/site2/django.wsgi
    </location>

</VirtualHost>

The closes thing I've seen is this http://docs.djangoproject.com/en/dev/howto/deployment/modpython/ but "mysite" is different for both of these cases and they're using mod_python instead of mod_wsgi.

Any help with this would be great thanks!

share|improve this question
up vote 1 down vote accepted

Use:

WSGIScriptAlias /site1 /var/www/html/site1/django.wsgi
WSGIScriptAlias /site2 /var/www/html/site2/django.wsgi

<Directory /var/www/html/site1>
Order allow,deny
Allow from all
</Directory>

<Directory /var/www/html/site2>
Order allow,deny
Allow from all
</Directory>

No need to scope it in a Location directive.

share|improve this answer

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.