I have setted a subdomain, serving a little pylons app.
My setting is:
WSGIScriptAlias / /path/to/my.wsgi
It's all ok, but there's a questions: my static files are beign served
though pylons, not apache.
How can I make the WSGIScriptAlias not match css and html files?
[]'s
- Walter
Create a directory for public static files and then set it up:
<Directory /var/www/html/my_sites_root/public>
SetHandler default-handler
</Directory>
Regards, Clodoaldo Pinto Neto
>
> []'s
> - Walter
>
> >
>
I don't find the above optimal as it means a lot of work on
deployment, I'll be happy if someone points me a better way.
> []'s
> - Walter
>
> >
>
For that, see mod_rewrite example for .htaccess file in:
http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines
This could also be done in Directory container in main Apache configuration.
This approach gives precedence to static files. On if no matched
static file does it get passed to WSGI application.
That document has other static file examples as well.
Graham
I've recently used:
WSGIScriptAliasMatch /(?!svn) /trac/app.wsgi
That's how I ended up serving <Location /svn> through mod_dav_svn, while
having the rest being handed-off to Trac.
I was hoping that having WSGIScriptAliasMatch / /trac/app.wsgi after <Location
/svn> would decrease its precedence. Got bitten by that assumption, and then I
found out about negative lookahead in regexes.
This helps?
--
Luis "Happy, happy mod_wsgi user" Bruno
I'll have to look up how that pattern works, but I would be a little
bit careful with it.
The reason is that WSGI applications are separated into different
Python interpreter instances based on the mount point. If the pattern
for a WSGIScriptAliasMatch targeted at a single WSGI script file can
match multiple URLs, then each of the matched URLs may end up being
dispatched to a different Python interpreter instances. This would be
reflected by SCRIPT_NAME being different for different URLs.
As well as causing distinct interpreters for each match URL, that
SCRIPT_NAME can be different may confuse some WSGI applications as
effective mount point will keep changing.
I'll have to remember to do some experimentation with this one.
Graham
I should write more carefully: I'm using WSGIScriptAliasMatch now; at the time
I was testing, that was a WSGIScriptAlias; no regexes involved.
> As well as causing distinct interpreters for each match URL, that
> SCRIPT_NAME can be different may confuse some WSGI applications as
> effective mount point will keep changing.
I vaguely remember that part of the docs. I think this didn't bite me because
I blindly copied "WSGIApplicationGroup %{GLOBAL}" inside <Directory /trac>, right?
That would certainly ensure it wouldn't be an issue, but as it turns
out my concerns were unwarranted anyway. That pattern always result in
same value of SCRIPT_NAME anyway.
Graham