[Zope] Still trying no success

Paul Everitt paul@digicool.com
Sun, 13 Jun 1999 07:54:38 -0400


"Robert W. Canary" wrote:
> 
> Well... still no succes with trying to get Zope to work.
> 
> It seems to me that in order to get Zope to work I have to completely
> scrap my Apache and turn it into a Zope web server.   I guess I am
> failing to see the concept here.   Does Zope take over everything?  I

No, "Zope" doesn't take over everything.  In fact, the thing that you
are getting frustrated about -- the Apache rewrite rule -- has nothing
to do with Zope.  It is Apache software and has been in Apache for about
the last two years.

The fact that it is hard to use and debug is definately a problem for
software like Zope that wants to integrate with Apache.  This is why the
Zope community works *very* hard to help people integrate Apache and
Zope, even though technically you're asking Apache questions.

In the end, though, the answer is no -- the rewrite rule should not take
over the rest of Apache.  I've used it many times with some URLs being
served off disk and others being served out of various Zope
installations.

> know this seems to be a strange question, but it seems from the rewrite
> rules that I have seen,  that the only way to get Zope to work is if one
> configures the rewrite rule to examine and rewrite all cgi's so it will

What evidence leads to that conclusion?  Perhaps many of the examples
are running Zope in the top of the URL tree, but the "Zap" distribution
of Apache provided at zope.org serves up the "/" URL as a static page.

Did you try Zap?  Even if you are going to throw it out and use your
own, it is still a useful existance proof that Zope integration works as
advertised.

Finally, as proof, here are some lines from our internal development
machine which is running Apache.  Requests to "/" go to the Document
Root on the filesystem.  Requests to ~paul go to my public_html
directory on the filesystem.  Finally, one of the many rewrite rules
send "/dav/" to a Zope installation:

DocumentRoot /usr/local/apache/htdocs
UserDir public_html
RewriteCond %{HTTP:Authorization}  ^(.*)
RewriteRule ^/dav(.*) /usr/local/apache/dev/dav$1 
[e=HTTP_CGI_AUTHORIZATION:%1,
t=application/x-httpd-cgi,l]

This is Apache 1.3.4.

> go through Zope.  However, If I have a cgi-bin and I want to run a cgi
> from that directory then it is going to get filtered by the rewrite
> rule.   The rewrite rule has a condition of ^/cgi-bin/Zope/(.*) and
> rewrites it to /home/httpd/cgi-bin/Zope/$1  according to the rewrite log
> (pasted below) I belive it is doing the rewrite correctly.
> 
> (2) init rewrite engine with requested uri /cgi-bin/Zope/Zope.cgi/manage
> 
> (3) applying pattern '^/cgi-bin/Zope/(.*)' to uri
> '/cgi-bin/Zope/Zope.cgi/manage'
> (4) RewriteCond: input='' pattern='^(.*)' => matched
> (2) rewrite /cgi-bin/Zope/Zope.cgi/manage ->
> /home/httpd/cgi-bin/Zope/Zope.cgi/manage
> (5) setting env variable 'HTTP_CGI_AUTHORIZATION' to ''
> (2) remember /home/httpd/cgi-bin/Zope/Zope.cgi/manage to have MIME-type
> 'application/x-httpd-cgi'
> (2) local path result: /home/httpd/cgi-bin/Zope/Zope.cgi/manage
> (1) go-ahead with /home/httpd/cgi-bin/Zope/Zope.cgi/manage [OK]
> (1) force filename /home/httpd/cgi-bin/Zope/Zope.cgi to have MIME-type
> 'application/x-httpd-cgi'
> 
> I have created a var directory under the httpd directory and included
> everything that was under the /var/local/Zope directory, and given
> everything there owner:nobody group:nobody rwxrwxrwx.    Yes. I altered
> the Zope.cgi to reflect these directory changes as well.
> 
> Now the question is what does Apache do with the Zope.cgi?
> 
> My access.conf includes a "<Directory /home/httpd/cgi-bin/Zope> Options
> ExecCGI </Directory>", and my srm.conf includes the line "ScriptAlias
> /cgi-bin/Zope/ /home/httpd/cgi-bin/Zope/"

Note that the "Zap" distribution puts everything in an httpd.conf file,
which I think is the new Apache way of doing things.
 
> When I go to my browser and type http://localhost/cgi-bin/Zope/Zope.cgi
> I get this error:
> 
> !  Temporarily Unavailable
>    The rescource you have requested is temporarily unavailable - please
> try again later.
>    (102) failure during connect
> 
> Can someone tell me what this means,  what cuases it?

First, it means that the Zope.cgi file _was_ executed by Apache.  This
file is a shell script which runs the binary PCGI wrapper executable. 
This executable checks to see if Zope is running.  If it isn't, it tries
to start it.

See if a pcgi.log file is created in your var directory, as well as a
.soc file.

--Paul