On 5 December 2010 06:51, Nikolaus Rath <[email protected]> wrote:
> Hello,
>
> I would like to run two WGSI applications in different process groups.
> However, they should be accessible was http://bla/app1 and http://bla/app2.
>
> How do I configure this?
>
> It seems to me that
>
> WSGIDaemonProcess group1 user=joe
> WSGIDaemonProcess group2 user=jeff
>
> WSGIProcessGroup group1
> WSGIScriptAlias /app1 /usr/local/wsgi/scripts/app1.wsgi
>
> WSGIProcessGroup group2
> WSGIScriptAlias /app2 /usr/local/wsgi/scripts/app2.wsgi
>
>
> Is unlikely to work because one ProcessGroup directory would override
> the other(?).

Do:

WSGIDaemonProcess group1 user=joe
WSGIDaemonProcess group2 user=jeff

WSGIScriptAlias /app1 /usr/local/wsgi/scripts/app1.wsgi

<Location /app1>
WSGIProcessGroup group1
</Location>

WSGIScriptAlias /app2 /usr/local/wsgi/scripts/app2.wsgi

<Location /app2>
WSGIProcessGroup group2
</Location>

In other words, use the Apache Location container directive to qualify
that the WSGIProcessGroup directive only applies to a specific sub URL
prefix.

You could also instead use the following if using mod_wsgi 3.X.

WSGIDaemonProcess group1 user=joe
WSGIDaemonProcess group2 user=jeff

WSGIScriptAlias /app1 /usr/local/wsgi/scripts/app1.wsgi process-group=group1
WSGIScriptAlias /app2 /usr/local/wsgi/scripts/app2.wsgi process-group=group2

That is, use process-group option to WSGIScriptAlias to override
process group for that mounted application.

If only the one WSGI application is running in each daemon process
group, actually suggested you instead use:

WSGIDaemonProcess group1 user=joe
WSGIDaemonProcess group2 user=jeff

WSGIScriptAlias /app1 /usr/local/wsgi/scripts/app1.wsgi \
  process-group=group1 application-group=%{GLOBAL}
WSGIScriptAlias /app2 /usr/local/wsgi/scripts/app2.wsgi  \
  process-group=group2 application-group=%{GLOBAL}

The application-group being set to %{GLOBAL} forces each to run in
main interpreter, which avoids problems with third party C extension
modules for Python that will not work properly in sub interpreters.

Also read:

http://blog.dscpl.com.au/2009/11/save-on-memory-with-modwsgi-30.html

for some other good practices.

Graham

-- 
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