>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: widgets.com
>> 
>> Local sites like: widgets.com/au, widgets.com/uk etc
>> 
>> An alias for widgets.com.au to widgets.com/au and an alias for widgets.co.uk 
>to
>> widgets.com/uk 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
>> widgets.com.au as virtual hosts resolving to the appropriate directory but 
the
>> documentation states "Note that the directory structures under the appBase 
for
>> 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 
>widgets.com.au to widgets.com/au
>
>One option that keeps the appearance of separate sites would be:
>- set up Tomcat to server widgets.com, widgets.com/uk, etc
>- use a reverse proxy (eg httpd)
>- configure the reverse proxy to proxy widgets.com.uk and widgets.com/uk to 
>/uk 

>on the Tomcat server
>
>Another option might be to set up a single host on Tomcat for widgets.com 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.
>
>Mark

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 
and 

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.

Andrew

Reply via email to