[mod_python] PythonConnectionHandler directive

Timothy Stebbing tim.stebbing at nunatak.com.au
Tue Dec 16 12:30:34 EST 2003


Im trying to get a simple protocol handler running, yet apache does not 
seem to be calling my code.

I have this in my apache config, this starts without any errors:

        ServerAdmin webmaster at localhost
        DocumentRoot /var/www/nunatak/
        ErrorLog /tmp/test-error.log
        LogLevel debug
        PythonConnectionHandler protocol

in /var/www/nunatak/protocol.py:

from mod_python import apache
def connectionhandler(conn):
    f = open("/tmp/foo.log", "w+")
    f.write("foo happened!\n")
    return apache.OK

when I telnet to localhost 4444 I get:

Connected to balrog.localnet.
Escape character is '^]'.
Connection closed by foreign host.

I have no /tmp/foo.log at all, which makes me think the script has not 
been located/run

in my ErrorLog for the virtual host I have:
[Tue Dec 16 23:26:23 2003] [error] python_connection: 
ConnectionDispatch() returned nothing.

Im guessing its a problem with my virtualhost definition not being set 
up correctly, but in the docs
for mod_python there is not much more info on this subject.


More information about the Mod_python mailing list