WSGIScriptAliasMatch usage

225 views
Skip to first unread message

Michael Anckaert

unread,
Jan 13, 2012, 5:08:17 AM1/13/12
to modwsgi
Hey everyone

I've been using mod_wsgi in production for some time with good
results. Yesterday I've stumbled into an issue where one of our django
installations get the "can't adapt to decimal error" where this blog
post (1) reports that it can be fixed by specifying the correct
process-group parameter to the WSGIScriptAlias directive.

But you guessed from the subject of this post that I'm using
WSGIScriptAliasMatch. Basically our platform is a collection of
various apps that are accessed via https://platform/appname/ the
directive below runs the correct django instance via modwsgi.

WSGIScriptAliasMatch ^/([^/]+) /var/www/instances/$1/django.wsgi

I looked and searched the internets far and wide but couldn't find any
working way to use modrewrite to specify the instance name and use it
as a process group. There is an example from the trac wiki that comes
close, but I can't seem to get it working.

Does anyone know a good solution to this problem or have some advice I
can check out?

Kind regards
Michael

Trac example code:

WSGIDaemonProcess site-1 user=user-1 group=user-1 threads=25
WSGIDaemonProcess site-2 user=user-2 group=user-2 threads=25
WSGIDaemonProcess site-3 user=user-3 group=user-3 threads=25

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/trac/([^/]+)
RewriteRule . - [E=trac.process_group:%1,\
E=trac.env_path:/usr/local/trac/sites/%1]

WSGIScriptAliasMatch ^/trac/([^/]+) /usr/local/trac/apache/trac.wsgi

<Directory /usr/local/trac/apache>
WSGIProcessGroup %{ENV:trac.process_group}
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>

(1) http://www.defitek.com/blog/2010/06/29/cant-adapt-type-decimal-error-with-django-apache-postgresql-psycopg2/

Graham Dumpleton

unread,
Jan 18, 2012, 7:27:23 PM1/18/12
to mod...@googlegroups.com
Are you running any other Python web sites besides Trac?

That you have WSGIApplicationGroup set to %{GLOBAL} should be sufficient to avoid the problem usually as its the application group which is the issue and not the process group.

If not, will need to get you to verify that the application group setting is applying properly and is actually running in the main interpreter.

Graham
> --
> You received this message because you are subscribed to the Google Groups "modwsgi" group.
> To post to this group, send email to mod...@googlegroups.com.
> To unsubscribe from this group, send email to modwsgi+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
>
>
Reply all
Reply to author
Forward
0 new messages