[opencms-dev] virtualhost example/tip sought

Christoph P. Kukulies kuku at physik.rwth-aachen.de
Thu Nov 3 16:28:26 CET 2005


On Thu, Oct 27, 2005 at 08:26:09PM +0200, Siegfried Puchbauer wrote:
> Your vhost config could look something like this:
> 
> NameVirtualHost *:80
> >
> > <VirtualHost *:80>
> > ServerName www.company.de <http://www.company.de>
> > DocumentRoot e:/Tomcat/tomcat4.1.24/webapps/opencms/
> >
> > ProxyPass /resources/ ! # Served by apache
> > ProxyPass /export/ ! # Served by apache
> >
> > ProxyPass /opencms/ http://localhost:8080/opencms/ #Your Tomcat Server
> > ProxyPassReverse /opencms/ http://localhost:8080/opencms/


Despite of the localhost (which puzzled me for a while and which I replaced
now by the actual host where the site and tomcat is hosted), what is
the ProxyPassReverse statement good for?




> >
> > RedirectPermanent / http://www.company.de/opencms/opencms/de/
> >
> > </VirtualHost>
> > <VirtualHost *:80>
> > ServerName www.company.com <http://www.company.com>
> > DocumentRoot e:/Tomcat/tomcat4.1.24/webapps/opencms/
> >
> > ProxyPass /resources/ ! # Served by apache
> > ProxyPass /export/ ! # Served by apache
> >
> > ProxyPass /opencms/ http://localhost:8080/opencms/ #Your Tomcat Server
> > ProxyPassReverse /opencms/ http://localhost:8080/opencms/
> >
> > RedirectPermanent / http://www.company.de/opencms/opencms/en/
> >
> > </VirtualHost>
> >
> 
> 2005/10/27, Christoph Kukulies <kuku at physik.rwth-aachen.de>:
> >
> >
> > I have a www-server that resolves to www.company.de<http://www.company.de>and an alias (CNAME)
> > that is www.company.com <http://www.company.com>.
> >
> > At present a javascript redirection in /index.html
> > acts like this
> >
> > <html>
> > <head>
> > <script language="JavaScript">
> > <!--
> > function gotoPage()
> > {
> > var dns1 = company.com <http://company.com>"
> > var dns2 = "company.de <http://company.de>"
> > var urlloc = location.href
> > var loc = urlloc.toLowerCase()
> >
> > if (loc.indexOf(dns1) != -1)
> > location.href="http://www.company.de/opencms/opencms/en/index.htm"
> >
> > if (loc.indexOf(dns2) != -1)
> > location.href="http://www.company.de/opencms/opencms/de/index.htm"
> >
> > }
> > //-->
> >
> > </head>
> >
> > <BODY onLoad="gotoPage()">
> > </body>
> > </html>
> >
> > This doesn't seem very robot friendly in the sense that my site is
> > traversed
> > nicely.
> >
> > I want to replace this by some Virtualhost mechanism in Apache.
> > But I can't figure out how.
> > I tried with a ReWriteRule ^/.* /opencms/opencms/*
> >
> > but this ends up in /opencms/opencms not found or something.
> > My DocumentRoot is e:/APache/Apache2/htdocs
> >
> > and
> >
> > opencms is in
> >
> > e:/Tomcat/tomcat4.1.24/webapps/opencms/export ...
> >
> >
> > I want to keep the DocumentRoot the same since the existing
> > opencms (4.x) installation relies on it.
> >
> > I'd greatly appreciate any advice.
> >
> >
--
Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de



More information about the opencms-dev mailing list