When there are VirtualHost's defined, if Apache can't map the host
name properly against the VirtualHost, then Apache will send the
request to the first VirtualHost definition it found. If that happened
to be the one for app_a, that would explain why everything goes to it.
First thing to check is that you have:
NameVirtualHost *:80
directive present and that it isn't commented out.
Then ensure that ServerName directive does have value the same as
actual host name using in the URL.
One other thing you can do is add in a default VirtualHost as very
first one, which from memory is defined as:
<VirtualHost __default__:80>
Deny from all
</VirtualHost>
With that in place, if named virtual host lookup is failing, will go
to that and you will get a forbidden error, rather than it going to
wrong virtual host.
Graham
> --
> You received this message because you are subscribed to the Google Groups "modwsgi" group.
> To post to this group, send email to mod...@googlegroups.com.
> To unsubscribe from this group, send email to modwsgi+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
>
http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Displaying_Request_Environment
Then compare what environ is for requests against different virtual
hosts to see if that gives a clue.
Strip any really sensitive information, trying not to change the
meaning, and post it.
Graham
WSGIDaemonProcess app_??? user=www-data group=www-data
Ie., drop processes/threads option. That way each daemon process group
has only one process and so can meaningfully compare process IDs for
each to make sure different.
Also provide copies of the two WSGI script files using for Django setup.
Graham
Graham
I'm currently running mod_wsgi 2.8 on Ubuntu Lucid, so the first thing I'll do is try to upgrade to mod_wsgi 3.X and report back if the problem has gone or not.
Note that Django expects the name of the site settings file to be stored in the environment variable DJANGO_SETTINGS_MODULE. This means that it is impossible to run two Django sites within one Python sub interpreter. This isn't in general a problem with mod_wsgi however, as the default for mod_wsgi is to execute each WSGI application within the context of its own Python sub interpreter.
But are you using daemon mode?
Provide a sample of your mod_wsgi configuration for a site.
If key is in the dictionary, return its value. If not, insert key with a value of default and return default. default defaults to None.
os.environ['DJANGO_SETTINGS_MODULE'] = 'example_com_site.settings'
- Benjamin
--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To view this discussion on the web visit https://groups.google.com/d/msg/modwsgi/-/uqBtTkv1h6YJ.
If the auto generated wsgi.py is using setdefault they have broken it very badly. When running in a multiple sub interpreter process, the first wsgi.py in any sub interpreter will win for the whole process. This is because setting os.environ, pushes values back out to process scope and when next sub interpreter is created it will pick up the value of the environment variable leaked from the other sub interpreter.I will have to look at original Django and if this is what they are doing, then yell a people about it.To fix, don't use setdefault. Just use '=' to set value in os.environ.Graham
Thanks for finding that existing ticket. I have added a comment but my
state of mind right now is such that not holding much hope that
anything will be done. If they want the existing behaviour for other
systems they could provide a check for when mod_wsgi and not do that,
but highly unlikely that they would add server specific checks.
Graham