Run Python as separate process with Apache?

Randall Parker rgparker at west.net
Mon Jul 10 16:09:41 EDT 2000


In news:<14697.3435.929500.668699 at beluga.mojam.com>, skip at mojam.com 
says...
>     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), 

Is ZServer written in Python? 

Is all of Zope a Python-based app server?

I went and looked at the http://www.zope.org site (I've seen Jon Udell 
rave about it in the past btw) and saw that it sounds like it is somehow 
more tightly tied to Python than to other scripting languages. Is that 
correct?

>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.

So there is a plug-in for Apache that can route requests to ZServer?

I did something with Java Servlets and the Tomcat engine where one can 
basically set a pattern in some config file that tells Apache that any 
urls that start with:
    http://www.somedomain.com/webapps
 should be routed to Tomcat. So this is possible to do with Apache and 
ZEngine and Apache can still handle all URLs that don't have a leading 
/webapps pattern?


> 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.

Does ZServer support other RDBMSs? 

MySQL doesn't scale high enough for what I have in mind. I've used it on 
a smaller project but am reluctant to use it on something big. Besides, 
its lacking transactions, subselects (what a pain) and some other stuff 
I've become accustomed to using. 

See a MySQL/Postgres comparison here:
   http://www.phpbuilder.com/columns/tim20000705.php3

> 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. 
 
With the Servlet API the actual act of asking for a session id causes the 
Tomcat engine (or any servlet api compliant container) to create one if 
it already doesn't exist and then to go set a cookie on the client 
browser all seamlessly without your having to do anything. Then it will 
do timeouts on the session id based on how long since it was last asked 
for. I'm hoping I can find something as slick and automatic in the 
Zope/Python world.




More information about the Python-list mailing list