9

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

I am trying to hook up Apache with mod_wsgi. I have used a virtual host to do so. see below:

<VirtualHost *:80>
ServerAdmin [email protected]
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 great for my django project when I go to testserver.com instead of my php index page I get my django project.

What I am looking for is help with allow my php projects in /var/www/html/ and my django projects to coexist. I am trying to make it so to reach my django project I type testserver.com/django

Any help or guidance is greatly appreciated :)

Thanks!

1 Answer 1

12

Change:

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

to:

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

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.