tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Knight <>
Subject Re: Is it possible to set up an alias to a directory?
Date Wed, 04 Aug 2010 08:39:43 GMT

>On 31/07/2010 04:36, Andrew Knight wrote:
>> Hi,
>> I've got a general configuration question for Tomcat 6. I've read the
>> documentation and done a bit of searching but could not find a solution. I'm
>> looking to set up the following:
>> International site:
>> Local sites like:, etc
>> An alias for to and an alias for 
>> etc for 27 countries
>> The idea is to have a seamless transition from domestic sites to directories
>> on a central site, but have the local market sites appear to function as
>> independent sites. We already have 27 local sites that have been in existence
>> for a long while and are well known to our customers.
>> I thought that it could be solved by setting up the local sites like
>> as virtual hosts resolving to the appropriate directory but 
>> documentation states "Note that the directory structures under the appBase 
>> each host should not overlap each other.". What are the issues when the
>> directory structures of virtual hosts overlap?
>Multiple deployments - particularly problematic if WARs are being used. It is 
>complicated by the fact that there is a fundamental different between docBase 
>>and appBase. It is not a simple directory structure.
>If this was just static content, a lot of the issues can be side-stepped but as 

>soon as you use WARS and/or dynamic content things get trickier.
>I assume that you don't want to put in place a simple redirect from 
> to
>One option that keeps the appearance of separate sites would be:
>- set up Tomcat to server,, etc
>- use a reverse proxy (eg httpd)
>- configure the reverse proxy to proxy and to /uk 

>on the Tomcat server
>Another option might be to set up a single host on Tomcat for with 
>aliases for all the other hosts and then add a filter that checks the host 
>>header and forwards the request to the right context.
>Note, YMMV - I haven't tested any of the above.

Hi Mark,

Thanks for the ideas, they make a lot of sense :-)

I can see a couple of them working well. I've been testing the domestic sites as 

symlinks to a /cms directory, and the content in /cms adapts for the appropriate 

local language etc based on the request. All the stuff in cms runs from 1 layout 

page that just calls appropriate jsp module pages for the content. 

I've just updated /index.jsp so that it detects if the request is for a cms page 

displays the relevant content (virtual host or symlink directory). This way is 
just runs 

as just 1 WAR file and I do not need to worry.

Thanks again.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message