[Zope] Apache+Zope (the big picture)

Evan Simpson evan@4-am.com
Tue, 24 Aug 1999 19:32:46 -0500


I should go to the beta site and make this a HOWTO.  Here's what I do:

All pages, including those from Zope, must be reachable with URLs which end
in '.html', since the pages are being edited (and the links maintained) in
Dreamweaver, which uses Windows file extension associations <choke>.  On the
other hand, I don't want to have to go around making Zope objects with IDs
ending in ".html'

I came up with the following framework:

1.  I can force a static URL by prefixing it with the 'site name'.
2.  I can force a dynamic URL by prefixing it with '/Zope/'
3.  No Zope object has a period in its ID, so any URL with a period is static
and any without is dynamic (but see #3).  The default homepage (a
bare "/") is also static.
4.  In Dreamweaver, all dynamic pages end in '.py.html', but they're stored
in Zope with no extension.  Apache strips all occurrences of '.py.html', and
hands the stripped URL back to the client.

For a site named "whizzo", I would have:

#1 and stop
 RewriteRule ^(/whizzo/.*) /home/httpd/html$1 [L]
#4, repeat until no more, and show to browser
 RewriteRule ^/(.*)\.py\.html(.*)$ $1$2 [R,N]
#2
 RewriteRule ^/Zope/(.*) /$1 [S=1]
#3 and stop
 RewriteRule !^/([^.]+)$ - [L]
 RewriteCond %{HTTP:Authorization}  ^(.*)
 RewriteRule ^/(.*) /home/httpd/cgi-bin/Zope.cgi/$1
[E=HTTP_CGI_AUTHORIZATION:%1,T=application/x-httpd-cgi,L]

Actually, I do a little more than this, since I serve several sites from the
same Zope process, but I haven't got that working with Zope 2 yet.

Tim Wilson wrote:

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