[opencms-dev] Virtual domains and aliases with mod_webapp?

Stephan Hartmann hartmann at waehrisch-feykes.de
Thu Feb 21 10:58:02 CET 2002

Hi Pekka,

the most easy way for all three cases is a redirect. But this will show your 
mydomain urls in the browser. if it doesn't mind, use it.

mod_rewrite could also be a good choice but it may conflict with the 
redirects opencms usese for pics and download folders, you can deactivate 
this in opencms.properties.

what you need is something like

RewriteEngine On
RewriteRule 	^/(.*)	http://mydomain.org/opencms/opencms/$1

But this would cause an external Redirect anyway because it is another host.

The directive 
RewriteRule 	^/(.*)	http://mydomain.org/opencms/opencms/$1 [P]
should use an internal Proxy, maybe what you need (needs mod_proxy).

Otherwise for case 2 and 3 use www.virtual.com as a ServerAlias for your 
mydomain.org and try this:

RewriteRule 	^/shop(.*)	/opencms/opencms/shop$1 
RewriteRule	^/admin(.*)	/opencms/opencms/system/workplace/action$1

(for your first case this might produce something like a loop, so be careful)

And not at last you can set up a second apache with mod_proxy for your 
www.virtual.com domain with something like

ProxyPass	/	http://mydomain.org/opencms/opencms/

Be careful with mod_proxy. A misconfigured apache with mod_proxy on makes it 
easy for proxyhunters.


Am Donnerstag, 21. Februar 2002 09:24 schrieben Sie:
> Hi,
> (This question is not exactly opencms-specific, but
> I hope it has enough relevance to be posted here)
> I would like to make virtual domains and/or aliases so that
>     http://www.virtual.com/
>        gives the same as
>     http://mydomain.org/opencms/opencms/
>     http://www.shop.com/
>        gives the same as
>     http://mydomain.org/opencms/opencms/shop/
>     http://www.virtual.com/admin/
>        gives the same as
>     http://mydomain.org/opencms/opencms/system/workplace/action/
> I already tried many different setting in httpd.conf,
> but all I can get is:
>      http://www.virtual.com/opencms/opencms/
>        to give the same as
>      http://mydomain.org/opencms/opencms/
> So here are my questions:
> *  Is it possible to do what I'm trying with httpd.conf,
>     or should I mangle with tomcat configuration instead?
> *  Should I use mod_rewrite instead of aliases for
>     the system/workplace/action-stuff? Examples, anyone?
> *  Is there any documentation and/or mailing list
>     for mod_webapp?
> I have installed apache-1.3.22, mod_webapp.so, tomcat-4.0.2,
> opencms-4.5.35RC, SunJava-1.4.0-rc-b91 into some Linuxes.
> Pekka

More information about the opencms-dev mailing list