I had a fairly simple question. When mod_wsgi is run in Daemon mode, and you enable the WSGIDaemonProcess
and WSGIProcessGroup
directives on a per virtual host basis, are these picked up by other virtual hosts as well?
For example, if I have:
<VirtualHost *:80>
WSGIDaemonProcess example.com processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup example.com
</VirtualHost>
<VirtualHost *:443>
WSGIProcessGroup example.com
</VirtualHost>
Will the second 443 virtual host use the existing "example.com" process group defined in the first 80 virtual host? Or do I have to redefine a separate process group within the second 443 virtual host?
Best Answer
Quoting the documentation at:
http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess
behaviour is:
So, you can reach across to daemon process definition in prior virtual host so long as same server name.
You also need to be aware of what is said in:
http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIApplicationGroup
whereby for default for WSGIApplicationGroup (ie., if not specified) is:
So, normally if you had separate WSGIScriptAlias for same mount point in the two virtual hosts for different ports, the two application instances would still be separated by running in different sub interpreters.
There is an exception to this rule though for the port 80/443 case whereby the port isn't actually included in the application group name. Thus in that case, applications mounted at same mount point would run in same sub interpreter.
This exception probably isn't explained as clearly as it could, but is covered by the definition:
that expansion of that being used as part of the default expansion above.