On Feb 7, 11:37 pm, Graham Dumpleton <[email protected]>
wrote:
> On 6 February 2010 14:50, Jason Garber <[email protected]> wrote:
>
>
>
>
>
> > Hi Ksenia,
> > Yes, this is possible.  What you need to do is run a single DaemonProcess
> > named, say, "Primary".  Then within each VirtualHost, you need
> > WSGIProcessGroup that refers to "Primary".
> > Something like this:
> >    WSGIApplicationGroup %{GLOBAL}
> >    WSGIDaemonProcess Primary threads=15 python-path=/foo/bar/Python
> >    <VirtualHost *:80>
> >        ServerName foo1.com
> >        WSGIProcessGroup Primary
> >        WSGIScriptAlias /User /foo/bar/app.wsgi
> >    </VirtualHost>
> >    <VirtualHost *:80>
> >        ServerName foo2.com
> >        WSGIProcessGroup Primary
> >        WSGIScriptAlias /User /foo/bar/app.wsgi
> >    </VirtualHost>
>
> You can actually put the WSGIProcessGroup outside of the VirtualHost 
> directive.
>
> Thus:
>
>    WSGIDaemonProcess Primary threads=15 python-path=/foo/bar/Python
>    WSGIProcessGroup Primary
>    WSGIApplicationGroup %{GLOBAL}
>
>    <VirtualHost *:80>
>        ServerName foo1.com
>        WSGIScriptAlias / /foo/bar/app.wsgi
>    </VirtualHost>
>    <VirtualHost *:80>
>        ServerName foo2.com
>        WSGIScriptAlias / /foo/bar/app.wsgi
>    </VirtualHost>
>
> I used '/' with WSGIScriptAlias as you asked for case where mounted at
> root of site.
>
> BTW, if the whole VirtualHost goes through to this application and
> nothing else is served by them, and every virtual host on server
> follows this same recipe, you could do away with the VirtualHost
> directives altogether and just put WSGIScriptAlias at global scope.


Thank you for answering. In our situation not all VirtualHost that are
hosted on the server are using the same application. So I guess
WSGIScriptAlias should go inside every VIrtualHost.
On another server we are using mod_wsgi for a different setup (one
virtualhost, one app), with the startup script that looks like:

#!/usr/bin/env python
import os
from paste.deploy import loadapp
from pkg_resources import resource_filename
app_path = os.path.dirname(resource_filename('myapp', ''))
if '/test/' in app_path:
    config_file = 'test.ini'
else:
    config_file = 'live.ini'
config_path = os.path.join(app_path, config_file)
application = loadapp('config:' + config_path)


But I think if I use this script in the situation with 300
VirtualHost, the same application will be loaded 300 times?! Is it how
it supposed to work?

Thanks again,
Ksenia

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to