[Zope] Apache+Zope (the big picture)

Michel Pelletier michel@digicool.com
Tue, 24 Aug 1999 19:55:20 -0400


Tim Wilson wrote:
> 
> Hi everyone,
> 
> I'm trying to get a handle on using Apache and ZServer together. I've read
> what seem to be the relevant docs, but I'm still unclear about something.
> 
> Let's say I have a Web server for a domain. Let's call it www.foo.com. I
> have a Web site in Zope, but for a number of reasons I need to serve up
> some non-Zope pages too (from the same www.foo.com).
> 
> Will setting up ZServer and Apache (with the virtual host and rewrite
> rules enabled) allow me to have a seamless experience for the person who
> visits my site. In other words, is it possible for
> http://www.foo.com/index_html (a Zope-powered page) and
> http://www.foo.com/example/hello.html (a normal HTML, Apache-served page)
> to live and play together nicely.
> 

Yes.  The trick is preceding your Zope rewrite rule with rewrite rules
that short cicuit the Zope rule.  Here is an example straight from our
website's httpd.conf:

RewriteEngine On
RewriteLog logs/rewrite_log
RewriteLogLevel 0
RewriteRule ^/mailman - [l]
RewriteRule ^/pipermail - [l]
RewriteRule ^/stats - [l]
RewriteRule ^/cgi-bin - [l]
RewriteRule ^/icons - [l]

RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^/(.*) /path/to/Zope.cgi/$1 [e=HTTP_CGI_AUTHORIZATION:
%1,t=application/x-httpd-cgi,l]

Note that that last rule should be all one line.  If any of the
preceding roles match the request in order from top to bottom, then that
rule is taken.  It's default action '-' is to do nothing, and it is
attributed to be a 'last' rule by 'l', meaning that rule processing
stops at that rule.  Thus, /mailman  /pipermail /stats /cgi-bin and
/icons is passed through normally to Apache.

-Michel

> Some teachers would probably like to have simple Web pages, and for now I
> want to make it as easy as possible. Also, some of my sysadmin tools use a
> Web interface that couldn't be replicated in Zope.
> 
> I hope that question is clear. For some reason it just doesn't make sense
> to me yet.
> 
> -Tim
> 
> --
> Timothy Wilson       | "The faster you  |  Check out:
> Henry Sibley H.S.    |  go, the shorter | http://slashdot.org/
> W. St. Paul, MN, USA |  you are."       | http://linux.com/
> wilson@chem.umn.edu  |       -Einstein  | http://www.mn-linux.org/
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (To receive general Zope announcements, see:
> http://www.zope.org/mailman/listinfo/zope-announce
> 
> For developer-specific issues, zope-dev@zope.org -
> http://www.zope.org/mailman/listinfo/zope-dev )