Project

General

Profile

ZopeRecipe » History » Revision 4

Revision 3 (Anonymous, 2007-01-31 05:43) → Revision 4/7 (Anonymous, 2007-01-31 05:44)

 
 == 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 Virtual Host Monster entry VirtualHostMonster [http://plone.org/documentation/tutorial/plone-apache/vhm] on Plone.org for a more thorough explaination on of how to order the URL rewrite. 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. 

 {{{ 
 # 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 ) ) ) 
 } 


 # 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 ) ) ) 
 } 


 # 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 ) ) ) 
 } 

 }}}