Run Python as separate process with Apache?

Skip Montanaro skip at mojam.com
Sun Jul 9 19:40:27 EDT 2000


    Randall> So I am wondering whether there is a way with Python and Apache
    Randall> to:

    Randall> 1) Have a persistent Python process that processes http
    Randall>    requests.

Yup, Medusa, Zope, the ZServer part of Zope (which is a lightly touched up
Medusa), or something based on the HTTPServer class in the Python core
should do the trick.  I use ZServer listening on 127.0.0.2 at port 9673 and
have Apache running on the same machine with proxy support.  It then proxies
to the server only those things I want the ZServer to see.

    Randall> 2) Have that persistent process manage a database connection
    Randall>    pool.

My ZServer then talks to a MySQL database using the MySQLdb module.  If you
want SQL connection capability I suspect you'll find Zope is much closer to
a complete solution.

    Randall> 3) Have that persistent process hand out new session ids for
    Randall>    new users, time them out automatically and all the other
    Randall> 	session management that servlet containers do for you.

Then I think you probably really want Zope.  There are tons of contributed
Zope products available.  There's bound to be one that will do session id
management. 

-- 
Skip Montanaro, skip at mojam.com, http://www.mojam.com/, http://www.musi-cal.com/
"To get what you want you must commit yourself for sometime" - fortune cookie




More information about the Python-list mailing list