Project

General

Profile

Actions

ZopeRecipe » History » Revision 3

« Previous | Revision 3/7 (diff) | Next »
Anonymous, 2007-01-31 05:43
The site id should go before the VirtualHostRoot label in order to hide it from the end user - placing the site id after VirtualHostRoot appears clean on the first rewrite but all subsequent site navigations will include the site id in the url


Zope & Plone Configurations

This example configuration is used to proxy to a Zope instance that is providing two Plone sites, and an ITracker site on one server. This example assumes that there is only one Zope server running on the same host, and the sites are all in the root folder. If your site is in another folder you need to adjust the configuration to reflect that. For example:

Please review the VirtualHostMonster [http://plone.org/documentation/tutorial/plone-apache/vhm] on Plone.org for a more thorough explaination of how to use VirtualHostBase/VirtualHostRoot.

{{{
url.rewrite-once = ( "^/(.*)$" =>
"/VirtualHostBase/http/site1.example.com:80/the_folder_name/site1/VirtualHostRoot/$1" )

VS.

url.rewrite-once = ( "^/(.*)$" =>
"/VirtualHostBase/http/site1.example.com:80/site1/VirtualHostRoot/$1" )

}}}

Note: I'm using the hash balance method because there is only one Zope server running. You may want to change this if you are running more than one Zope server. Please check out the proxy module docs for more information.

{{{
  1. Proxy to the first Plone site.

$HTTP["host"] == "site1.example.com" {

url.rewrite-once = ( "^/(.*)$" =>
"/VirtualHostBase/http/site1.example.com:80/site1/VirtualHostRoot/$1" )

proxy.balance = "hash"
proxy.server = ( "/VirtualHostBase" =>
(
( "host" => "127.0.0.1", "port" => 8080 ) ) )
}

  1. Proxy to the second Plone site.

$HTTP["host"] == "site2.example.com" {

url.rewrite-once = ( "^/(.*)$" =>
"/VirtualHostBase/http/site2.example.com:80/site2/VirtualHostRoot/$1" )

proxy.balance = "hash"
proxy.server = ( "/VirtualHostBase" =>
(
( "host" => "127.0.0.1", "port" => 8080 ) ) )
}

  1. Proxy to an ITracker instance.

$HTTP["host"] == "sitebugs.example.com" {

url.rewrite-once = ( "^/(.*)$" =>
"/VirtualHostBase/http/sitebugs.example.com:80/VirtualHostRoot/sitebugs/$1" )

proxy.balance = "hash"
proxy.server = ( "/VirtualHostBase" =>
(
( "host" => "127.0.0.1", "port" => 8080 ) ) )
}

}}}

Updated by Anonymous over 17 years ago · 3 revisions