[mod_python] apache API and mod_python <-> protocol module integration

Gregory (Grisha) Trubetskoy grisha at modpython.org
Thu Jul 17 13:09:08 EST 2003


I think this is unnecessary. Something like this in the config will make
your handler listen on 1.1.1.1:8888 only:

Listen 2.2.2.2:80
Listen 1.1.1.1:8888

<VirtualHost 1.1.1.1:8888>

	PythonConnectionHandler blah
	...

</VirtualHost>


On Thu, 17 Jul 2003, Robert Sanderson wrote:

>
> You can check the address it was received on and decline to handle
> anything received on the wrong port. Then it'll fall through to the
> normal handlers.
>
> For example:
>
> def connectionhandler(conn):
>   if (conn.local_addr[0] != SERVER_IP or conn.local_addr[1] != SERVER_PORT):
>     return apache.DECLINED
>   elif (conn.base_server.server_hostname != SERVER_NAME):
>     return apache.DECLINED
>   else:
>     # XXX do everything here
>
>   return apache.OK
>
>
> Also look at conn.base_server for the server object's other bits and
> pieces.
>
> http://www.modpython.org/live/current/doc-html/pyapi-mpconn-mem.html
> http://www.modpython.org/live/current/doc-html/pyapi-mpsrv-mem.html
>
> Rob
>
>
> On Thu, 17 Jul 2003, fitnah55 wrote:
>
> >
> > path problem.. couldn't specify that the connection handler was in a
> > specific
> > place, so i added a blah.pth file to site-packages pointing to the lib
> > directory of the host..
> >
> > i can actually run the virtual host without specifying a documentroot so
> > i
> > guess that works out fine
> >
> > but i'm not so sure canonical name type name based virtual hosts will
> > work
> > with this as is though?
> >
> > i think right now using the virtual host directive is essentially just
> > giving
> > it its own error log
> >
> > i can actually start developing a rudimentary design now though so
> > that's
> > pretty cool... it took a lot less effort than i thought when i first
> > started
> > looking into it
> >
> >
> > > -----Original Message-----
> > > From: Gregory (Grisha) Trubetskoy [mailto:grisha at modpython.org]
> > > Sent: Wednesday, July 16, 2003 11:20 PM
> > > To: fitnah55
> > > Cc: mod_python at modpython.org
> > > Subject: RE: [mod_python] apache API and mod_python <->
> > > protocol module integration
> > >
> > >
> > >
> > > There is some sort of an error in your code, but because of a
> > > bug that was
> > > fixed earlier your mod_python doesn't log the error in the
> > > log correctly.
> > >
> > > Attached is another patch, this time to apache.py, that should log the
> > > error correctly.
> > >
> > > Grisha
> > >
> > > On Wed, 16 Jul 2003, fitnah55 wrote:
> > >
> > > >
> > > > duh.. add the port to listen
> > > >
> > > > heh
> > > >
> > > > coincidentally, i don't think the echo example is working
> > > >
> > > > [Tue Jul 15 13:03:18 2003] [error] python_connection:
> > > > ConnectionDispatch() returned nothing.
> > > >
> > > > hmm
> > > >
> > > > _______________________________________________
> > > > Mod_python mailing list
> > > > Mod_python at modpython.org
> > > > http://mailman.modpython.org/mailman/listinfo/mod_python
> > > >
> > >
> > _______________________________________________
> > Mod_python mailing list
> > Mod_python at modpython.org
> > http://mailman.modpython.org/mailman/listinfo/mod_python
> >
>
> --
>       ,'/:.          Rob Sanderson (azaroth at liverpool.ac.uk)
>     ,'-/::::.        http://www.o-r-g.org/~azaroth/
>   ,'--/::(@)::.      Special Collections and Archives, extension 3142
> ,'---/::::::::::.    Nebmedes:  telnet: nebmedes.o-r-g.org 7777
> ____/:::::::::::::.                WWW:  http://nebmedes.o-r-g.org:8000/
> I L L U M I N A T I
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list