[mod_python] Possible Bug in PythonHandlerModule directive

Troy Wilson wilsonta72 at gmail.com
Wed Nov 28 04:42:06 EST 2007


Hi all,

I can not seem to get the PythonHandlerModule directive to work. The
following conf works:
-------------------------------------------------------------
<Directory /home/test/public_html>
                Options -Indexes -MultiViews
                <IfModule mod_python.c>
                        SetHandler python-program
                        PythonAuthenHandler handler
                        PythonAuthzHandler handler
                        PythonHandler handler
                        PythonDebug On
                        PythonInterpreter test
                        PythonAutoReload On
                        AuthType python-auth
                        AuthName "Restricted"
                        require valid-user
                </IfModule>
</Directory>
-----------------------------------------------

While this setup produces a 401 error:
---------------------------------------------------
 <Directory /home/test/public_html>
                Options -Indexes -MultiViews
                <IfModule mod_python.c>
                        SetHandler python-program
                        PythonHandlerModule handler
                        PythonDebug On
                        PythonInterpreter test
                        PythonAutoReload On
                        AuthType python-auth
                        AuthName "Restricted"
                        require valid-user
                </IfModule>
</Directory>
------------------------------------------------

The simplest form of the handler code:
--------------------------------------------------
from mod_python import apache

def authenhandler(req):
        req.user = "test"
        return apache.OK

def authzhandler(req):
        return apache.OK

def handler(req):
        return apache.OK

---------------------------------------------------------

My understanding was that the PythonHandlerModule directive would search
inside the handler code for a function matching the phase. It does not seem
to do this.Have I misinterpreted what this directive was meant to achieve?

Cheers Troy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20071128/cf6ee0e1/attachment-0001.html


More information about the Mod_python mailing list