I have a working Django app hosted on my linode (Fedora 15), and I'm attempting to host a php-based site there as well. I'm using name-based virtual hosts to redirect requests based on the host name, but for some reason, every request is going to the Django app. I'm thinking perhaps mod_wsgi is overriding some defaults? Or maybe a syntax error with my virtual hosts (I've tried DocumentRoot with and without quotes)? Here are the relevant parts of my httpd config file:
Name VirtualHost *:80 <VirtualHost *:80> ServerName pollvaultr.com ServerAlias www.pollvaultr.com WSGIDaemonProcess pollvaultr.com user=apache group=apache WSGIProcessGroup pollvaultr.com WSGIScriptAlias / "/var/www/html/PollVaultr/wsgi.py" Alias /static/ "/var/www/html/static/" <Directory "/var/www/html/static"> Order allow,deny Allow from all </Directory> <Directory "/var/www/html/PollVaultr"> <Files "wsgi.py"> Order allow,deny Allow from all </Files> </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "/var/www/catfacts/" ServerName lexiross.com ServerAlias www.lexiross.com </VirtualHost>
And here is my wsgi.py script:
import os, sys sys.path.append('/var/www/html') sys.path.append('/var/www/html/PollVaultr') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PollVaultr.settings") import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
httpd -e DEBUG does not reveal any bugs. Here is the tail of my error_log file:
[Fri Feb 24 20:36:42 2012] [info] mod_wsgi (pid=5893): Create interpreter 'lexiross.com|'. [Fri Feb 24 20:36:42 2012] [info] mod_wsgi (pid=5893): Adding '/var/www/html/' to path. [Fri Feb 24 20:36:42 2012] [info] [client 184.108.40.206] mod_wsgi (pid=5893, process='', application='lexiross.com|'): Loading WSGI script '/var/www/html/PollVaultr/wsgi.py'.
Any ideas what could be going on? mod_wsgi definitely shouldn't be dealing with requests made to lexiross.com - why won't those requests head to the alternate document root? I should also mention that this is my first time doing sysadmin work, so I'm very new at this! Thanks.