tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Knight <and...@leftfieldpublishing.com>
Subject Re: Is it possible to set up an alias to a directory?
Date Wed, 04 Aug 2010 08:39:43 GMT
=0A=0A>On 31/07/2010 04:36, Andrew Knight wrote:=0A>> Hi,=0A>> =0A>> I've
g=
ot a general configuration question for Tomcat 6. I've read the=0A>> docume=
ntation and done a bit of searching but could not find a solution. I'm=0A>>=
 looking to set up the following:=0A>> =0A>> International site: widgets.co=
m=0A>> =0A>> Local sites like: widgets.com/au, widgets.com/uk etc=0A>> =0A>=
> An alias for widgets.com.au to widgets.com/au and an alias for widgets.co=
.uk =0A>to=0A>> widgets.com/uk etc for 27 countries=0A>> =0A>> The idea
is =
to have a seamless transition from domestic sites to directories=0A>> on a =
central site, but have the local market sites appear to function as=0A>> in=
dependent sites. We already have 27 local sites that have been in existence=
=0A>> for a long while and are well known to our customers.=0A>> =0A>> I
th=
ought that it could be solved by setting up the local sites like=0A>> widge=
ts.com.au as virtual hosts resolving to the appropriate directory but =0Ath=
e=0A>> documentation states "Note that the directory structures under the a=
ppBase =0Afor=0A>> each host should not overlap each other.". What are the =
issues when the=0A>> directory structures of virtual hosts overlap?=0A>=0A>=
Multiple deployments - particularly problematic if WARs are being used. It =
is =0A>complicated by the fact that there is a fundamental different betwee=
n docBase =0A>>and appBase. It is not a simple directory structure.=0A>=0A>=
If this was just static content, a lot of the issues can be side-stepped bu=
t as =0A=0A>soon as you use WARS and/or dynamic content things get trickier=
.=0A>=0A>I assume that you don't want to put in place a simple redirect fro=
m =0A>widgets.com.au to widgets.com/au=0A>=0A>One option that keeps the app=
earance of separate sites would be:=0A>- set up Tomcat to server widgets.co=
m, widgets.com/uk, etc=0A>- use a reverse proxy (eg httpd)=0A>- configure t=
he reverse proxy to proxy widgets.com.uk and widgets.com/uk to /uk =0A=0A>o=
n the Tomcat server=0A>=0A>Another option might be to set up a single host =
on Tomcat for widgets.com with =0A>aliases for all the other hosts and then=
 add a filter that checks the host =0A>>header and forwards the request to =
the right context.=0A>=0A>Note, YMMV - I haven't tested any of the above.=
=0A>=0A>Mark=0A=0AHi Mark,=0A=0AThanks for the ideas, they make a lot of se=
nse :-)=0A=0AI can see a couple of them working well. I've been testing the=
 domestic sites as =0A=0Asymlinks to a /cms directory, and the content in /=
cms adapts for the appropriate =0A=0Alocal language etc based on the reques=
t. All the stuff in cms runs from 1 layout =0A=0Apage that just calls appro=
priate jsp module pages for the content. =0A=0AI've just updated /index.jsp=
 so that it detects if the request is for a cms page =0Aand =0A=0Adisplays =
the relevant content (virtual host or symlink directory). This way is =0Aju=
st runs =0A=0Aas just 1 WAR file and I do not need to worry.=0A=0AThanks ag=
ain.=0A=0AAndrew=0A
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message