I have an existing pcgi setup and want to start using ZServer as well. I just don't how to get them both running. The Zope 2 INSTALL.txt says: * You can use PCGI and an existing web server if you use ZServer. How? Do you: python w_pcgi.py or wo_pcgi.py? start ZServer with what args? The docs are a bit confusing: wo_pcgi == without pcgi ==> ZServer and ODB3 w_pcgi == with pcgi ==> without ZServer (ODB2?) Therefore how to combine ZServer and PCGI? I know ZServer has a PCGI channel. Therefore maybe the above scripts should instead be named w_zserver and wo_zserver, because you can use pcgi in either case? As you can tell, I'm totally confused here. Would someone provide an example? Thanks, Alex Rice
At 09:52 PM 6/14/99 -0600, you wrote:
I have an existing pcgi setup and want to start using ZServer as well. I just don't how to get them both running.
Look at ZServer/INSTALL.txt and ZServer/README.txt Also try the ZServer start script: $ python1.5.2 z2.py -h
The Zope 2 INSTALL.txt says:
* You can use PCGI and an existing web server if you use ZServer.
How? Do you:
python w_pcgi.py or wo_pcgi.py? start ZServer with what args?
w_pcgi.py will compile the PCGI wrapper which you will need unless you are using mod_pcgi or already have it compiled. The basic idea of using PCGI and ZServer is this: browser <--HTTP--> webserver <--CGI--> pcgi wrapper <--PCGI--> ZServer Basically using PCGI with ZServer is exactly like using PCGI normally, except for the fact that the long running process that the PCGI wrapper communicates with is ZServer, not pcgi_publisher.py The upshot of this difference is that you need to start ZServer before you can use PCGI, since the PCGI wrapper does not currently know how to activate ZServer. Also you need to configure ZServer to communicate w/ PCGI, which is normally done by passing the path to a PCGI info file to the PCGI Server.
Therefore how to combine ZServer and PCGI? I know ZServer has a PCGI channel. Therefore maybe the above scripts should instead be named w_zserver and wo_zserver, because you can use pcgi in either case? As you can tell, I'm totally confused here.
Clearly we need to improve our documentation, and our installation programs :-( Note: we haven't yet overhauled the install documentation for Zope 2. As always, we're open to constructive criticism, suggestions, and contributions. -Amos
Amos Latteier wrote Clearly we need to improve our documentation, and our installation programs :-( Note: we haven't yet overhauled the install documentation for Zope 2. As always, we're open to constructive criticism, suggestions, and contributions.
just a suggestion - make an index_html in the standard ZODB3 file. It's very confusing otherwise to just get <Main> when you go to the root of the Zope site. Anthony
On Mon, 14 Jun 1999 22:18:24 -0700, Amos Latteier <amos@aracnet.com> said: Amos> Look at ZServer/INSTALL.txt and ZServer/README.txt Amos> Also try the ZServer start script: Amos> $ python1.5.2 z2.py -h Yes, thanks. Amos> w_pcgi.py will compile the PCGI wrapper which you will need unless Amos> you are using mod_pcgi or already have it compiled. Amos> The basic idea of using PCGI and ZServer is this: Amos> browser <--HTTP--> webserver <--CGI--> pcgi wrapper <--PCGI--> ZServer Amos> Basically using PCGI with ZServer is exactly like using PCGI Amos> normally, except for the fact that the long running process that Amos> the PCGI wrapper communicates with is ZServer, not Amos> pcgi_publisher.py The upshot of this difference is that you need Amos> to start ZServer before you can use PCGI, since the PCGI wrapper Amos> does not currently know how to activate ZServer. Also you need to Amos> configure ZServer to communicate w/ PCGI, which is normally done Amos> by passing the path to a PCGI info file to the PCGI Server. OK, that clarifies things quite a bit. However, here is what I have. I still can't get it working. (using 2.0a2, python 1.5.2) I have already have a working Apache rewrite rule I have been using for some time with pcgi_publisher. % python w_pcgi.py % chown -R nobody var/ % chgrp -R nobody var/ % cp Zope.cgi /home/httpd/cgi-bin/ % python z2.py -d 198.59.115.2 -p Zope.cgi ** [ why can't I leave off the DNS server, and let -p default to Zope.cgi? ] zinit: Tue Jun 15 00:12:19 1999: Houston, we have forked zinit: Tue Jun 15 00:12:19 1999: Houston, we have forked zinit: Tue Jun 15 00:12:19 1999: Hi, I just forked off a kid: 4596 log: adding channel <trigger at 83dbcf8> log: adding channel <zhttp_server at 8407960> Warning: computing default hostname Medusa (V1.7) started at Tue Jun 15 00:12:24 1999 Hostname: localhost Port:9673 log: adding channel <FTPServer at 8407948> FTP server started at Tue Jun 15 00:12:24 1999 Authorizer:None Hostname: monsoon Port: 9221 log: adding channel <PCGIServer at 84287c8> log: adding channel <secure_monitor_server at 8429728> Monitor Server (V1.2) started on port 9999 ** [ now I browse to http://localhost/manage and I get this back from z2.py] log: adding channel <PCGIChannel at 84290a0> Unhandled exception in thread: Traceback (innermost last): File "/usr/share/Zope-2.0.0a2-src/ZServer/PubCore/ZServerPublisher.py", line 97, in __init__ response._finish() File "/usr/share/Zope-2.0.0a2-src/ZServer/PCGIServer.py", line 348, in _finish self.stdout.close() File "/usr/share/Zope-2.0.0a2-src/ZServer/PCGIServer.py", line 383, in close Wakeup() File "/usr/share/Zope-2.0.0a2-src/ZServer/medusa/select_trigger.py", line 80, in pull_trigger self.trigger.sendto (msg, self.addr) socket.error: (13, 'Permission denied') **[ ^C out of z2.py, and look for other python processes, there are none] Amos> Clearly we need to improve our documentation, and our installation Amos> programs :-( Note: we haven't yet overhauled the install Amos> documentation for Zope 2. As always, we're open to constructive Amos> criticism, suggestions, and contributions. It's very likely that I shouldn't be mucking around with an alpha release. However I really want to learn Zclasses and start using FTP and WebDav. Also if this is going to ship this month then I guess you need as many monkeys banging on it as possible? Once this all sinks in (and I get it running) I'll try to make some constructive suggestions. Alex Rice | alrice@swcp.com | http://www.swcp.com/~alrice Current Location: N. Rio Grande Bioregion, Southwestern USA
At 12:24 AM 6/15/99 -0600, Alex Rice wrote: ...
% python w_pcgi.py % chown -R nobody var/ % chgrp -R nobody var/ % cp Zope.cgi /home/httpd/cgi-bin/ % python z2.py -d 198.59.115.2 -p Zope.cgi
** [ why can't I leave off the DNS server, and let -p default to Zope.cgi? ]
You should be able to leave out the DNS server and allow -p to default to Zope.cgi. What's stopping you? BTW, why are changing the ownership of var to nobody but seemingly running ZServer as your userid?
** [ now I browse to http://localhost/manage and I get this back from z2.py]
log: adding channel <PCGIChannel at 84290a0> Unhandled exception in thread: Traceback (innermost last): File "/usr/share/Zope-2.0.0a2-src/ZServer/PubCore/ZServerPublisher.py", line 97, in __init__ response._finish() File "/usr/share/Zope-2.0.0a2-src/ZServer/PCGIServer.py", line 348, in _finish self.stdout.close() File "/usr/share/Zope-2.0.0a2-src/ZServer/PCGIServer.py", line 383, in close Wakeup() File "/usr/share/Zope-2.0.0a2-src/ZServer/medusa/select_trigger.py", line 80, in pull_trigger self.trigger.sendto (msg, self.addr) socket.error: (13, 'Permission denied')
OK, this is a generic medusa problem. My guess is that you'll get this from any sort of access to ZServer such as HTTP, FTP, PCGI, etc. The select trigger is a socket file in the /tmp directory which ZServer uses to wake up the select call after it finishes publishing in a thread. My guess is that there is some permissions problem, perhaps in the /tmp directory which is keeping ZServer from writing to the socket file. Hope this helps. -Amos
On Tue, 15 Jun 1999 09:25:04 -0700, Amos Latteier <amos@aracnet.com> said: Amos> You should be able to leave out the DNS server and allow -p to Amos> default to Zope.cgi. What's stopping you? INSTALL.txt says: You *must* specify a DNS server in z2.py or via command-line options. (but it doesn't say why) I thought perhaps -p was the same way... Amos> BTW, why are changing the ownership of var to nobody but seemingly Amos> running ZServer as your userid? Actually, I'm running ZServer as root, assuming it will become nobody.
File "/usr/share/Zope-2.0.0a2-src/ZServer/medusa/select_trigger.py", line 80, in pull_trigger self.trigger.sendto (msg, self.addr) socket.error: (13, 'Permission denied')
Amos> OK, this is a generic medusa problem. My guess is that you'll get Amos> this from any sort of access to ZServer such as HTTP, FTP, PCGI, Amos> etc. The select trigger is a socket file in the /tmp directory Amos> which ZServer uses to wake up the select call after it finishes Amos> publishing in a thread. My guess is that there is some permissions Amos> problem, perhaps in the /tmp directory which is keeping ZServer Amos> from writing to the socket file. No other programs have trouble writing to /tmp. Maybe I have a stale socket file in /tmp. Will clean it out. More tonight... Thanks, Alex Rice | alrice@swcp.com | http://www.swcp.com/~alrice Current Location: N. Rio Grande Bioregion, Southwestern USA
No other programs have trouble writing to /tmp. Maybe I have a stale socket file in /tmp. Will clean it out. More tonight...
Alex, Not been keeping up with the thread (sorry), but here's a common scenario which often describes your symptom. 1. Developers writes file to /tmp with user permissions during local testing. 2. Application tested. Attempt to run app as a web server 'nobody' process. Process fails due to write permission error. 3. Developer slaps forehead. Uses chmod or chown to change file mode/owner settings. Time for a beer, which causes developer's brain to double in power. Best regards, Jeff Bauer Rubicon, Inc.
Alex wrote:
No other programs have trouble writing to /tmp. Maybe I have a stale socket file in /tmp. Will clean it out. More tonight...
Jeff wrote:
Not been keeping up with the thread (sorry), but here's a common scenario which often describes your symptom.
1. Developers writes file to /tmp with user permissions during local testing. 2. Application tested. Attempt to run app as a web server 'nobody' process. Process fails due to write permission error. 3. Developer slaps forehead. Uses chmod or chown to change file mode/owner settings. Time for a beer, which causes developer's brain to double in power.
This sounds like the problem. I would guess that ZServer is creating a file in /tmp as root, then changing to uid to nobody, then it tries to write to the file in /tmp and fails. This is going to take a little tinkering on my part to get right, probably I'll delay writing the trigger file until after the suid. But you should be able to test this by starting ZServer then looking for /tmp/.select-trigger.<PID> and checking its ownership, and manually fixing it if you feel like it. -Amos P.S. Actually there is a newer medusa select trigger that may not suffer from these problems, but I am still having trouble getting it to work under win32...
Yes, sure enough, if I chown the .select-trigger.X file which appears in /tmp, I get no errors. Thanks Amos, Jeff! On Tue, 15 Jun 1999 10:56:36 -0700, Amos Latteier <amos@aracnet.com> said: Amos> Alex wrote:
No other programs have trouble writing to /tmp. Maybe I have a stale socket file in /tmp. Will clean it out. More tonight...
Amos> Jeff wrote:
Not been keeping up with the thread (sorry), but here's a common scenario which often describes your symptom.
1. Developers writes file to /tmp with user permissions during local testing. 2. Application tested. Attempt to run app as a web server 'nobody' process. Process fails due to write permission error. 3. Developer slaps forehead. Uses chmod or chown to change file mode/owner settings. Time for a beer, which causes developer's brain to double in power.
Amos> This sounds like the problem. I would guess that ZServer is Amos> creating a file in /tmp as root, then changing to uid to nobody, Amos> then it tries to write to the file in /tmp and fails. Amos> This is going to take a little tinkering on my part to get right, Amos> probably I'll delay writing the trigger file until after the suid. Amos> But you should be able to test this by starting ZServer then Amos> looking for /tmp/.select-trigger.<PID> and checking its ownership, Amos> and manually fixing it if you feel like it. Alex Rice | alrice@swcp.com | http://www.swcp.com/~alrice Current Location: N. Rio Grande Bioregion, Southwestern USA
participants (4)
-
Alex Rice -
Amos Latteier -
Anthony Baxter -
Jeff Bauer