0

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/...is this possible? Even a different port would be great, I just would like to see both sites.

2 Answers 2

1

Use the Alias directive

Something like

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

in your virtual host configuration

2
  • Hm this seems to keep my php localhost intact but when I go to localhost/django I am getting a 403 error? Jul 25, 2011 at 4:09
  • Alias directive is not sufficient by itself. See my other answer. Jul 25, 2011 at 23:14
0

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:

http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango

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:

http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Conference_Presentations

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .