Apache+Zope (the big picture)
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. 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/
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 )
On Tue, 24 Aug 1999, Michel Pelletier wrote:
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.
Thanks Michel. That really helps. Among other things, I plan to install Mailman too so I'll steal that line directly. :-) I notice from the Zope page that a binary Apache is available. What does the static binary include that may not be in my RedHat 6.0 version of Apache? Thanks again. -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/
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.
participants (3)
-
Evan Simpson -
Michel Pelletier -
Tim Wilson