On 24 March 2010 16:34, Deron Meranda <[email protected]> wrote:
> On Tue, Mar 23, 2010 at 8:35 PM, Graham Dumpleton
> <[email protected]> wrote:
>>> RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f
>>
>> Am not sure REQUEST_URI will always work in that situation as it isn't
>> decoded nor are repeating slashes removed.
>
> Good point. Better to use %{REQUEST_FILENAME}.
> Still, you need the %{DOCUMENT_ROOT} part if in a virtual host.
>
>
> Anyway I just tried out the WSGIHandlerScript directive, and it works
> great! (as long as you have 3.0 or greater) That was exactly what
> I was looking for.
>
> One difference between it and mod_python's PythonHandler that
> stood out to me as somewhat significant is that this WSGI directive
> apparently isn't allowed in the .htaccess or scopes other than server-level.
Correct. I see the job of specifying special handlers for new resource
types to be a job of the Apache administrator. Usually it is something
that would only be achievable by adding new Apache modules, something
else only an administrator can do.
But then, the Action directive is allowed in FileInfo override
context, ie., .htaccess, so one can do something similar that way. As
such, it perhaps should be allowed in .htaccess files and allowing
that is pretty simple to do. Just change:
AP_INIT_RAW_ARGS("WSGIHandlerScript", wsgi_add_handler_script,
NULL, ACCESS_CONF|RSRC_CONF, "Location of WSGI handler script file."),
to:
AP_INIT_RAW_ARGS("WSGIHandlerScript", wsgi_add_handler_script,
NULL, OR_FILEINFO, "Location of WSGI handler script file."),
and let me know if any problems come up with using it in .htaccess files.
> Though, for most cases, you can still use the 'SetHandler wsgi-script'
> approach to override the WSGIHandlerScript in whatever config scopes
> you want. Or you could just turn your main wsgi handler into more of a
> dispatcher/middleware layer.
>
> So its not a that big of a restriction; just a bit different.
>
>
> Graham, I know you're terribly busy, but perhaps at some point could you
> update the wiki page ConfigurationDirectives to get it up to date? I had
> assumed it reflected the latest, and hence just didn't discover the
> WSGIHandlerScript on my own.
>
> You do have it (and many other newer features) documented in the various
> changelog pages -- it would just be nice to have it all in one place.
I know it isn't up to date. Finding time, and motivation, is hard.
The WSGIHandlerScript directive is also still a little subject to
tweaking and why I wasn't really publicising it. :-)
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.