[mod_python] Complicated GET configuration

Ian Clelland ian at veryfresh.com
Fri Aug 16 13:27:45 EST 2002

On Fri, Aug 16, 2002 at 01:22:30PM -0400, Hunter Matthews wrote:
> POST requests that are simple XMLRPC calls. 
> One of the idiosyncrases of the client is that the URL that is requested
> is ALWAYS just /XMLRPC  - there is no script name or whatever.
> I can handler these fine with the following config snippet:
> <Location /XMLRPC>
>     SetHandler python-program
>     PythonHandler current_apache
> </Location>
> The GET requests have me stymied - to transfer big files, the client
> uses GET requests. I'd like to have apache itself do the actual shifting
> of bits, and just let my server application handle the authentication
> that is required.
> What I had as a first attempt was:
> <Location /XMLRPC/$RHN>
>     SetHandler python-program
>     PythonAuthzHandler current_apache
> </Location>
> But this is clearly wrong (and it doesn't work, either :) 
> Because I have the SetHandler, mod_python tries to handle ALL the
> different parts of the request, when I only want it to handle the Authz
> stage: if that PythonAuthzHandler returns  apache.OK, then I would like 
> apache to pick up the URL and just fling it back at the client - the
> python part is done.

Because of the <Location> directive, Apache will hand all requests for 
/XMLRPC and any URL below that to your python module. If you don't want 
mod_python to handle the GET requests underneath /XMLRPC, then your 
handler should return apache.DECLINED if req.uri != '/XMLRPC'.

Also, as far as I understand it, the SetHandler directive shouldn't be 
required in order to invoke a PythonAuthzHandler, but I could be wrong. 
(Not that it will make a difference in your case; the SetHandler for 
/XMLRPC will also affect the /XMLRPC/$RHN subdirectory anyway)

Ian Clelland
<ian at veryfresh.com>

More information about the Mod_python mailing list