>
> Since you are using mod_wsgi 3.4, you can get rid of WSGIPythonHome and
> use python-home option to WSGIDaemonProcess instead:
>
> # App A
> # The same process should host /root/foo/A, /root/bar/A, etc.
> WSGIDaemonProcess appA user=www-data group=www-data \
> python-home=/wsgi/shared/A/env display-name=%{GROUP}
> WSGIScriptAliasMatch ^/root/[^/]+/A /wsgi/shared/A/A.wsgi \
> process-group=appA application-group=%{GLOBAL}
>
> # App B
> # The same process should host /root/foo/B, /root/bar/B, etc.
> WSGIDaemonProcess appB user=www-data group=www-data \
> python-home=/wsgi/shared/BA/env display-name=%{GROUP}
> WSGIScriptAliasMatch ^/root/[^/]+/B /wsgi/shared/B/B.wsgi \
> process-group=appB application-group=%{GLOBAL}
>
> This avoids needing to each down into the Python virtual environment.
>
Yes, this is exactly the option I was trying to find in the docs and
couldn't. This simplifies things greatly.
I went ahead and removed that bootstrap section from the inis.
>
> Have also used process-group and application-group to avoid separate
> Location for overriding.
>
> I am concerned though as to why you are using WSGIScriptAliasMatch in the
> first place.
>
> That should only ever be used as a last resort.
>
> As far as I can tell it should be equivalent to:
>
> # App A
> # The same process should host /root/foo/A, /root/bar/A, etc.
> WSGIDaemonProcess appA user=www-data group=www-data \
> python-home=/wsgi/shared/A/env display-name=%{GROUP}
> WSGIScriptAlias /root/A /wsgi/shared/A/A.wsgi \
> process-group=appA application-group=%{GLOBAL}
>
> # App B
> # The same process should host /root/foo/B, /root/bar/B, etc.
> WSGIDaemonProcess appB user=www-data group=www-data \
> python-home=/wsgi/shared/BA/env display-name=%{GROUP}
> WSGIScriptAlias /root/B /wsgi/shared/B/B.wsgi \
> process-group=appB application-group=%{GLOBAL}
>
> Why are you using WSGIScriptAliasMatch?
>
> Do you really want the sites URL prefixed with '/root'?
>
So we have multiple URLs we're trying to map back to the same WSGI script
alias. E.g. we have
http://server/root/client1/appA
http://server/root/client2/appA
http://server/root/client3/appA.
I figured out my original problem by following your suggestion of verifying
the right mode/interpreter context.
When I loaded http://server/root/client1/appA it was getting the right
daemon process, but http://server/root/client1/appA/ or any child path, it
was running in embedded mode.
So something wasn't working with my <Location /root/*/A> block. The docs I
can find say it should have worked recursively so not sure why it wasn't.
I wanted to eliminate the location block anyways once you told me about
those extra options I can pass to WSGIScriptAlias.
I first tried them with WSGIScriptAliasMatch but got this error:
... waiting Syntax error on line 30 of /etc/apache2/conf.d/wsgi.conf:
>
> Invalid option to WSGI script alias definition.
>
>
I then converted by WSGIScriptAliasMatch to a bank of N WSGIScriptAlias's
like so:
WSGIScriptAlias /root/client1/A /wsgi/shared/A/A.wsgi \
>
> process-group=A application-group=%{GLOBAL}
>
> WSGIScriptAlias /root/client2/A /wsgi/shared/A/A.wsgi \
>
> process-group=A application-group=%{GLOBAL}
>
> WSGIScriptAlias /root/client3/A /wsgi/shared/A/A.wsgi \
>
> process-group=A application-group=%{GLOBAL}
>
> WSGIScriptAlias /root/client4/A /wsgi/shared/A/A.wsgi \
>
> process-group=A application-group=%{GLOBAL}
>
> WSGIScriptAlias /root/client5/A /wsgi/shared/A/A.wsgi \
>
> process-group=A application-group=%{GLOBAL}
>
> WSGIScriptAlias /root/client6/A /wsgi/shared/A/A.wsgi \
>
> process-group=A application-group=%{GLOBAL}
>
>
It sort of sucks having to duplicate all those config lines, but I guess
it's not as bad as the alternative,
and everything is working as I expect now with no mixing of environments,
so I got that going for me.
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.