Almost NOBODY seems to cover this little problem I'm having. I have a massive site, that must be migrated picemeal to zope. I would like to create virtual urls that pass into zope. I do not want to use virtual host in apache, nor do I want to use proxypass because of problems I've ran into with that. example www.mysite.com -> served by apache www.mysite.com/section_in_zope -> served by zope www.mysite.com/other_section_in_zope -> served by zope if I setup a proxypass so that /section_in_zope/ goes to www.mysite.com:8080/section_in_zope (which works), all my links (file.html) now go to www.mysite.com:8080/section_in_zope/file.html. So i set a siteroot for section_in_zope, with base http://www.mysite.com/section_in_zope/ and base /section_in_zope/. The problem with that is now the link file.html goes to http://www.mysite.com/section_in_zope/section_in_zope/file.html and it grows with each new link. So basically I suspect rewrite will be my answer. How would I go about setting up both apache and zope to do that? -jim
So i set a siteroot for section_in_zope, with base http://www.mysite.com/section_in_zope/ and base /section_in_zope/. The problem with that is now the link file.html goes to http://www.mysite.com/section_in_zope/section_in_zope/file.html and it grows with each new link.
I could be totally wrong--I'm a relative newbie--but I wonder if your problem is related to the insidious <base href="/"/> problem. // mark -
One VHM in zope root. Then just use RewriteCond together with RewriteRule to direct your traffic. If you want to use SSL then you must use VirtualHost to split up https and http reguests. http://httpd.apache.org/docs/mod/mod_rewrite.html http://httpd.apache.org/docs/vhosts/index.html Pay attention to REQUEST_URI It is your special friend :) RewriteEngine on RewriteCond %{REQUEST_URI} ^/section_served_by_zope/(.*)$ RewriteRule ^/(.*) http://127.0.0.1:8080/VirtualHostBase/http/www.mysite.com:80/VirtualHostRoot /$1 [P] This should help you on your the way. \Oliver
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Jim Kutter Sent: 6. august 2002 22:11 To: zope@zope.org Subject: [Zope] Apache Rewrite w/o VHM
Almost NOBODY seems to cover this little problem I'm having.
I have a massive site, that must be migrated picemeal to zope. I would like to create virtual urls that pass into zope. I do not want to use virtual host in apache, nor do I want to use proxypass because of problems I've ran into with that.
example
www.mysite.com -> served by apache www.mysite.com/section_in_zope -> served by zope www.mysite.com/other_section_in_zope -> served by zope
if I setup a proxypass so that /section_in_zope/ goes to www.mysite.com:8080/section_in_zope (which works), all my links (file.html) now go to www.mysite.com:8080/section_in_zope/file.html. So i set a siteroot for section_in_zope, with base http://www.mysite.com/section_in_zope/ and base /section_in_zope/. The problem with that is now the link file.html goes to http://www.mysite.com/section_in_zope/section_in_zope/file.html and it grows with each new link.
So basically I suspect rewrite will be my answer. How would I go about setting up both apache and zope to do that? -jim _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.381 / Virus Database: 214 - Release Date: 02-08-2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.381 / Virus Database: 214 - Release Date: 02-08-2002
On Tue, Aug 06, 2002 at 04:10:45PM -0400, Jim Kutter wrote:
I have a massive site, that must be migrated picemeal to zope. I would like to create virtual urls that pass into zope. I do not want to use virtual host in apache, nor do I want to use proxypass because of problems I've ran into with that.
An adaptation of what I wrote up in http://www.zope.org/Members/mwr/VHosts_With_Zope_Default should work, I'd think. Of course, where I'm defaulting to Zope content and letting Apache handle specific cases, you'd be doing the opposite, and the RewriteRules would change accordingly. My method does use mod_proxy, but doesn't use ProxyPass specifically. I'd think something like (completely untested): <IfModule mod_rewrite.c> RewriteEngine On RewriteLog "/var/log/apache/rewrite_log" RewriteLogLevel 1 RewriteRule ^/section_in_zope/(.*) \ http://my.real.host.name:9673/VirtualHostBase/http/my.virtual.host.name:80/z... [P] RewriteRule ^/other_section_in_zope/(.*) \ http://my.real.host.name:9673/VirtualHostBase/http/my.virtual.host.name:80/o... [P] RewriteRule ^/(.*) [L] </IfModule> with a VirtualHostMonster in Zope's root folder object would do it. No ProxyPass and ProxyPassReverse, no SiteAccess rules locking you out of the site, and the VHM should handle changing the base href tag. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
Jim Kutter wrote:
if I setup a proxypass so that /section_in_zope/ goes to www.mysite.com:8080/section_in_zope (which works), all my links (file.html) now go to www.mysite.com:8080/section_in_zope/file.html. So i set a siteroot for section_in_zope, with base http://www.mysite.com/section_in_zope/ and base /section_in_zope/. The problem with that is now the link file.html goes to http://www.mysite.com/section_in_zope/section_in_zope/file.html and it grows with each new link.
Forget SiteRoot. Delete it, add a VirtualHostMonster named 'vhm' to your Zope root, and change your ProxyPass to the following (all one line): ProxyPass /section_in_zope http://localhost:8080/VirtualHostRoot/http/www.mysite.com:80/ This assumes that Zope is on the same server as Apache ('localhost') and that there's a Zope Folder named 'section_in_zope'. Cheers, Evan @ 4-am
Hey Evan, Why one over the other? I have been using SiteRoot and AccessRules for years (literally since you wrote it). What does VHM get me that those two do not? Cheers, BZ At 4:19 PM -0500 8/6/02, Evan Simpson wrote:
Jim Kutter wrote:
if I setup a proxypass so that /section_in_zope/ goes to www.mysite.com:8080/section_in_zope (which works), all my links (file.html) now go to www.mysite.com:8080/section_in_zope/file.html. So i set a siteroot for section_in_zope, with base http://www.mysite.com/section_in_zope/ and base /section_in_zope/. The problem with that is now the link file.html goes to http://www.mysite.com/section_in_zope/section_in_zope/file.html and it grows with each new link.
Forget SiteRoot. Delete it, add a VirtualHostMonster named 'vhm' to your Zope root, and change your ProxyPass to the following (all one line):
ProxyPass /section_in_zope http://localhost:8080/VirtualHostRoot/http/www.mysite.com:80/
This assumes that Zope is on the same server as Apache ('localhost') and that there's a Zope Folder named 'section_in_zope'.
Cheers,
Evan @ 4-am
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
BZ wrote:
Why one over the other? I have been using SiteRoot and AccessRules for years (literally since you wrote it). What does VHM get me that those two do not?
If you're an experienced and competent user of SiteRoots, there's probably not an especially compelling reason to switch. I personally like the fact that I only need one VHM, plus a very straightforward Apache config pattern. AccessRules don't have a replacement, and I continue to use them for various tasks. Again and again, however, people trying to use SiteRoots for the first time panic when they appear to have locked themselves out of the ZMI. Just about as frequently, I see posts from folks who think they have successfully set up virtual hosting, but their paths are screwed up because they didn't understand the proper use of Base and Path. No amount of documentation seems to stem the tide of wounded feet ;-) Cheers, Evan @ 4-am
participants (6)
-
BZ -
Evan Simpson -
Jim Kutter -
Mark McEahern -
Mike Renfro -
Oliver Marx