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

Right now, my http://localhost/ address for all of my php sites (which are in my Sites folder).

However, my django sites will be in my /Users/myusername/djcode/www/ folder.

How do I see my django sites through typing http://localhost/django/ but still see my php sites when I go to http://localhost/ this possible? Even a different port would be great, I just would like to see both sites.

share|improve this question

Use the Alias directive

Something like

Alias /django /Users/myusername/djcode/www/

in your virtual host configuration

share|improve this answer
Hm this seems to keep my php localhost intact but when I go to localhost/django I am getting a 403 error? – redconservatory Jul 25 '11 at 4:09
Alias directive is not sufficient by itself. See my other answer. – Graham Dumpleton Jul 25 '11 at 23:14

Follow the normal mod_wsgi setup instructions for Django with exception that you will mount your Django application at a sub URL and not at the root of the web site. See:

Where it gives as example:

WSGIScriptAlias / /usr/local/django/mysite/apache/django.wsgi

you will instead use:

WSGIScriptAlias /django /usr/local/django/mysite/apache/django.wsgi

Just remember to change '/usr/local/django/mysite' to where you have actually put the Django site and WSGI script file for your Django site. This applies to the Directory directive in the configuration as well that documentation says to create.

Also watch:

to find out why you get various errors due to not following what the documentation says plus other file system permissions issues.

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.