On Jan 29, 2012, at 1:27 PM, André Warnier wrote:
> 
> Sorry to appear to pounce on you, but putting a <Context> element in 
> server.xml is discouraged, see here :
> http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Introduction
> 
No offense taken 

> I am not myself an expert, so treat this with caution, but to summarise so 
> far :

Same here, we're all doing the same, trying to be helpful in some way
> 
> 1) the easiest and recommended way is to deploy the application as 
> ${CATALINA_BASE}/webapps/ROOT.war. That is the normal place for an 
> application invoked as "/", it will not confuse anyone, and it will work with 
> or without a front-end.

This isn't what the original poster asked, he asked for a way without renaming

> 2) instead, in some cases (and only since Tomcat 7.x), you can use the 
> "trick" indicated previously by Pid

This isn't what the original poster asked, he was talking about Tomcat 6
> 3) place a Context description in 
> $CATALINA_BASE/conf/[enginename]/[hostname]/ROOT.xml, with an attribute : 
> docBase="(full path to the application's .war archive)"  (whatever you decide 
> to name the .war archive). Put the .war archive outside of tomcat's webapps 
> directory then, to avoid a double deployment.

This is a nice option, however putting war's outside of the webapps directory 
might be very confusing. 

> 4) deploy the application as you wish, and use VirtualHost and/or Rewrite 
> and/or Proxy rules at the front-end httpd level to achieve what you want.  
> But this is more complex to do right as it appears initially. (You may have 
> to be careful about links embedded inside your pages, for example).
> 
This is a nice solution too, however if an application for some reason uses 
applets or generates it's URL's in a non-standard way, this might not work. I 
do realize the downsides of modifying the server.xml and including a context 
element, but it might be a working approach and answers the question the 
original poster has. 

John

Reply via email to