Hi, I'm in the process of writing a Roxen (webserver) module which should interface with Zope. I would like to do the same as the fastcgi module does for Apache. I have set up a simulation program, which simulates Zope in order to get the Roxen module to work. Using the simulation programm everything is fine, but when using Zope .... I need to know what to send to the socket (true TCP, not domain!) and what to expect from it. I start Zope with the following options: z2.py -X -u 90 -F 4445 -D Looking at the sources of Zope, I gathered the following: - open the socket - send a 10byte header containing the length of the following block as zero padded ascii - send the block containing the environment variables, each of the form: variable=value\0 - send a 10byte header containing the length of the following block as zero padded ascii - send the block containing the data from the browser (excluding the headers). - wait for a 10byte header containing the length of the following block as zero padded ascii - read the data to be sent to the browser, adding the confirmation line (e.g. HTTP 200 OK\r\n) - wait for a 10byte header containing the length of the following block as zero padded ascii - read the error data - close the socket Is this correct? What environment variables are neccessary? Thanks for any clarification, I really, really hope that someone out there can enlighten me and that I can get the module to work! Robert ------------------------------------- Institut fuer Informatik tel +41 (0)61 267 14 66 Universitaet Basel fax. +41 (0)61 267 14 61 Robert Frank Klingelbergstrasse 50 Robert.Frank@unibas.ch (NeXT,MIME mail ok) CH-4056 Basel (remove any no_spam_ from my return address) Switzerland http://www.ifi.unibas.ch/~frank
On Wed, 8 Aug 2001, Robert Frank wrote:
I'm in the process of writing a Roxen (webserver) module which should interface with Zope. I would like to do the same as the fastcgi module does for Apache. I have set up a simulation program, which simulates Zope in order to get the Roxen module to work. Using the simulation programm everything is fine, but when using Zope ....
Start here: http://www.suxers.de/python/fcgi.htm Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
Hi Robert, hmm. I never really understand what value pcgi adds to zope more then in situations mod_proxy and friends are not available. I did not make measurements, but from what I see from others, zope with pcgi is slower then zserver. You also loose the various zserver modules like ftp and the extra DAV source port. Even some upcoming extra services like smtp and imap can be used then. So, if its not for academical reasons, I dont think you should invest too much energy in this project. Hint: the pcgi specs should be available on apache.org. If you use tcp, just install zope and apache on different servers and watch the conversation with ethereal. Regards Tino --On Mittwoch, 8. August 2001 16:20 +0200 Robert Frank <Robert.Frank@unibas.ch> wrote:
Hi,
I'm in the process of writing a Roxen (webserver) module which should interface with Zope. I would like to do the same as the fastcgi module does for Apache. I have set up a simulation program, which simulates Zope in order to get the Roxen module to work. Using the simulation programm everything is fine, but when using Zope ....
I need to know what to send to the socket (true TCP, not domain!) and what to expect from it. I start Zope with the following options: z2.py -X -u 90 -F 4445 -D
Looking at the sources of Zope, I gathered the following: - open the socket
- send a 10byte header containing the length of the following block as zero padded ascii - send the block containing the environment variables, each of the form: variable=value\0 - send a 10byte header containing the length of the following block as zero padded ascii - send the block containing the data from the browser (excluding the headers).
- wait for a 10byte header containing the length of the following block as zero padded ascii - read the data to be sent to the browser, adding the confirmation line (e.g. HTTP 200 OK\r\n) - wait for a 10byte header containing the length of the following block as zero padded ascii - read the error data
- close the socket
Is this correct? What environment variables are neccessary?
Thanks for any clarification, I really, really hope that someone out there can enlighten me and that I can get the module to work!
Robert ------------------------------------- Institut fuer Informatik tel +41 (0)61 267 14 66 Universitaet Basel fax. +41 (0)61 267 14 61 Robert Frank Klingelbergstrasse 50 Robert.Frank@unibas.ch (NeXT,MIME mail ok) CH-4056 Basel (remove any no_spam_ from my return address) Switzerland http://www.ifi.unibas.ch/~frank
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hello! On Wed, 8 Aug 2001, Tino Wildenhain wrote:
hmm. I never really understand what value pcgi adds to zope more then in situations mod_proxy and friends are not available.
No, you are wrong. PCGI protocol, for example, passess the entire environment from Apache, including REMOTE_ADDRESS. Proxy screws the REMOTE_ADDRESS.
I did not make measurements, but from what I see from others, zope with pcgi is slower then zserver. You also loose the various zserver modules like ftp and the extra DAV source port. Even some upcoming extra services like smtp and imap can be used then.
You are partially right, and partially wrong. You are talking about Zope in PCGI-only (no ZServer) mode. Yes, this is slow and inconvenient. But ZServer includes PCGI server, too. So run Zope with ZServer with PCGI, and connect Apache with mod_pcgi2. This is a bit faster than mod_proxy. Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
<fixed><fontfamily><param>Ohlfs</param>Ah, now we're slowly getting there ... <nofill>
Hello! [...] You are partially right, and partially wrong. You are talking about Zope in PCGI-only (no ZServer) mode. Yes, this is slow and inconvenient. But ZServer includes PCGI server, too. So run Zope with ZServer with PCGI, and connect Apache with mod_pcgi2. This is a bit faster than mod_proxy. </nofill>
That's what I want to do: run Zope with ZServer (z2.py -X -F socket_number) and then connect with my Roxen module. So it is *that* protocol I'm after: the one between the mod_pcgi2 and the ZServer ... Is that documented some where? Is it the same as the one used between the cgi-wrapper and the ZServer? Robert ------------------------------------- Institut fuer Informatik tel +41 (0)61 267 14 66 Universitaet Basel fax. +41 (0)61 267 14 61 Robert Frank Klingelbergstrasse 50 Robert.Frank@unibas.ch (NeXT,MIME mail ok) CH-4056 Basel (remove any no_spam_ from my return address) Switzerland http://www.ifi.unibas.ch/~frank </fontfamily></fixed>
On Thu, 9 Aug 2001, Robert Frank wrote:
So run Zope with ZServer with PCGI, and connect Apache with mod_pcgi2. This is a bit faster than mod_proxy. </nofill>
That's what I want to do: run Zope with ZServer (z2.py -X -F socket_number) and then connect with my Roxen module. So it is *that* protocol I'm after: the one between the mod_pcgi2 and the ZServer ...
Is that documented some where?
I don't know.
Is it the same as the one used between the cgi-wrapper and the ZServer?
Not only it is the same - when I was creating mod_pcgi2 I copied almost all code from the pcgi-wrapper, so the ocde is almost the same. I fixed one or two minor problem and wrote Apache things... well, I copied some code from AMK's mod_pcgi, but this has nothing with the very PCGI protocol. Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
Hi, --On Donnerstag, 9. August 2001 12:29 +0400 Oleg Broytmann <phd@phd.pp.ru> wrote:
Hello!
On Wed, 8 Aug 2001, Tino Wildenhain wrote:
hmm. I never really understand what value pcgi adds to zope more then in situations mod_proxy and friends are not available.
No, you are wrong. PCGI protocol, for example, passess the entire environment from Apache, including REMOTE_ADDRESS. Proxy screws the REMOTE_ADDRESS.
yeah, right. It even does not pass it with the via header (the same for squid. I would consider this to be a bug btw.)
I did not make measurements, but from what I see from others, zope with pcgi is slower then zserver. You also loose the various zserver modules like ftp and the extra DAV source port. Even some upcoming extra services like smtp and imap can be used then.
You are partially right, and partially wrong. You are talking about Zope in PCGI-only (no ZServer) mode. Yes, this is slow and inconvenient. But ZServer includes PCGI server, too. So run Zope with ZServer with PCGI, and connect Apache with mod_pcgi2. This is a bit faster than mod_proxy.
Ah, interesting. One never stops learning :-) Thanks Tino :)
participants (3)
-
Oleg Broytmann -
Robert Frank -
Tino Wildenhain