Multiple Django Apps on single Apache2 server occasionally load incorrect URLS file
|Reported by:||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by )
This is a rather odd bug we've come across in development, but here is the gist of it:
Two completely separate projects, Hostbase and Cellbill, are attempting to run simultaneously on a shared Apache2 server.
Hostbase and all its supporting files live in /var/www/webapps/ihw.
Cellbill and all its supporting files live in /var/www/webapps/cellbill
Each project has its own separate configuration file in /etc/apache2/webapps.d/ that defines locations and directories as per http://www.djangoproject.com/documentation/modpython/; each project resides at http://webserver/projectname/ where projectname is Hostbase or Cellbill. Here is the Config file for Cellbill; Hostbase is nearly identical (save things that shouldn't affect this):
Alias /cellbill/site_media /var/www/webapps/cellbill/site_media <Directory /var/www/webapps/cellbill/site_media/> Options FollowSymLinks AllowOverride none order allow,deny allow from all </Directory> Alias /cellbill/django_media /var/www/webapps/cellbill/lib/django/contrib/admin/media <Directory /var/www/webapps/cellbill/lib/django/contrib/admin/media/> Options FollowSymLinks AllowOverride none order allow,deny allow from all </Directory> Alias /cellbill /var/www/webapps/cellbill <Location "/cellbill/"> order allow,deny allow from all SetHandler python-program PythonDebug On PythonPath "['/var/www/webapps/cellbill','/var/www/webapps/cellbill/lib'] + sys.path" PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE cellbill.settings </Location> #remove mod_python function from static media <Location "/cellbill/site_media/"> SetHandler None </Location> <Location "/cellbill/django_media/"> SetHandler None </Location>
The problem is that when someone goes to http://webserver/cellbill/, it will occasionally (typically not repeatedly, but sometimes) load the URL conf for Hostbase, and subsequently throw a 404 error (since none of my URLs match theirs) and vice versa with their project and my URL conf.
Anyone have any idea what might be going on? We are the only two people running Django projects currently, however more are likely to come to this server in the future. Naturally we would like to figure out what is going on before more projects are deployed.