I have an Apache server running on my machine (port 80) I have a Zope server running on my machine (port 8080)
i want all users, irrespective of domain (lets use www.example.com for now) to be pushed to the zope instance, seamlessly
IE if i type into my browser http://www.example.com/mysite
it will display the effects of http://www.example.com:8080/mysite
BUT
i want the URL to still say http://www.example.com/mysite
(sub-)domain should be irrespective, as will have 2 or 3 domains pointing to the same server
am i supposed to be looking at mod_rewrite or mod_proxy?
I have the mod_rewrite half working,l but it changes what is in the browser?
currently trying
RewriteEngine on
RewriteRule ^($|/.*) http://localhost:8080/$1 [P]
but getting server 500
Connecting using "http://localhost/mysite"
You can use either
mod_rewrite
with aP
(proxy) rule ormod_proxy
to do what you want. Usingmod_rewrite
your configuration would look something like this:Using
mod_proxy
, your config would look like this:Both accomplish approximately the same thing. Using a
Location
block withProxyPass
makes it easy to apply other configuration directives to this path on the front-end server.Zope supports your scenario out-of-the-box with some special rewriting, using a
VirtualHostMonster
flags in the path. This ensures that any URLs generated by Zope (and by extension, Plone) are correct for proxied requests as well.You should use both
mod_rewrite
andmod_proxy
, they'll be working in concert.To make creating the right rewrite URLs easier, someone built an excellent RewriteRule Witch. Plugging in your specific example outputs:
Thus, for any URLs rooted at
http://www.example.com/mysite
, rewrite these to be served from the server running on localhost port 8080, making sure that Zope generates URLs with the same root.See the detailed documentation on the VirtualHostMonster feature on the Zope wiki for more details.