Setting up a Django virtual host. Apache mod_wsgi

I hope there is a simple answer to my question, as I am not the most experienced with python and Apache.

I am trying to connect Apache using mod_wsgi. For this, I used a virtual host. see below:

<VirtualHost *:80> ServerAdmin admin@example.com ServerName testserver.com/django #DocumentRoot / WSGIScriptAlias / /home/mycode/mysite/scripts/django.wsgi Alias /media/ /home/mycode/mysite/mysite/media/ Alias /adminmedia/ /opt/python2.7/lib/python2.7/site-packages/django/contrib/admin/media/ <Directory "/home/mycode/mysite/mysite/media"> Order deny,allow Allow from all </Directory> </VirtualHost> 

This works fine for my django project when I go to testerver.com instead of my php index page. I get my django project.

What I'm looking for is help that allows my php projects in / var / www / html / and my django projects to coexist. I am trying to achieve my django project. I type testerver.com/django

Any help or guidance is appreciated :)

Thanks!

+7
source share
1 answer

Edit:

 WSGIScriptAlias / /home/mycode/mysite/scripts/django.wsgi 

in

 WSGIScriptAlias /django /home/mycode/mysite/scripts/django.wsgi 

The first argument is the mount point, you have the root of the web server, so just change it to '/ django'.

+11
source

All Articles