Log in |
Changing host names dynamically with ApacheA single Zope instance via Zope.cgi under Apache can be made to render pages who's contents appear to be from different hosts by altering the SERVER_URL environment variable. Situations where this capability is essential are:
You can remedy this by setting the SERVER_URL environment variable in Apache appropriately just prior to invoking Zope.cgi. Here are two ways to do it: 1) For Apache virtual hosts that need to point to a single Zope instance, put SetEnv SERVER_URL http://hostname.orginto the various VirtualHost sections you've defined at a point prior to where Zope.cgi is called (e.g. before a RewriteRule that runs Zope.cgi). hostname.org should be whatever host you want Zope to pretend it is for the virtual host in question. 2) For Apache+Zope configurations that need to be accessible on both sides of a a tunneling proxy configuration, put SetEnvIf Remote_Addr "A\.B\.C\.D" SERVER_URL=http://hostname.orginto your Apache configuration someplace before Zope.cgi is called. A\.B\.C\.D is the IP address of the near side of your proxy server (with periods made literal, 'cause SetEnvIf uses regular expressions), and hostname.org is the name that people on the far side see your proxy server as. Note that this isn't specific to a VirtualHost configuration, though it'll work in that context as well (just put the SetEnvIf inside whatever virtual hosts you've defined). Questions/suggestions? |