tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Tomcat 6 - How to make an application available at www.mydomain.com
Date Sun, 29 Jan 2012 12:27:24 GMT
John Renne wrote:
> On Jan 29, 2012, at 4:35 AM, Dean Del Ponte wrote:
> 
>> I'm running tomcat 6 behind apache.
>>
>> I currently have an application deployed as "myApplication" and it is
>> available at "http://www.mydomain.com/myApplication".
>>
>> How can I make this application available at "http://www.mydomain.com"
>> without deploying it as ROOT.war?
>>
> If I remember well, you could accomplish this by adding a line like this in the server.xml:
> <Context path="" docbase="myApplication">
> </Context>
> 
> I've always considered it a bit ugly but it should do the trick
> 

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

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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message