You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kent Boogaart <kb...@essential.com.au> on 2003/12/10 08:53:03 UTC

Default context for web app

Hi all,

I am trying make my web application available via the default context. In
other words, when I type http://localhost:8080/ in a browser on the local
machine I want my web app to appear rather than the Tomcat default web app.

I figured I'd just need to alter my context's path to "" (empty string) and
alter the existing root context to use "/root" for it's path rather than "".
Whilst this kind of works (my web app is available via
http://localhost:8080/) it has an unfortunate side effect. My web app is
started up twice - once in the "" context and again in another context based
on my web app's name ("/eSM").

How can I use the default context and only the default context for my web
app?

Thanks,
Kent

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


Re: Default context for web app

Posted by Ben Souther <bs...@fwdco.com>.
If you've manually deployed your app and it's the only one running in that 
server, you could turn off autoDeploy from the host node in your server.xml 
file. 

Then Tomcat would only deploy the apps that you've specifically set up context 
elements for.

-Ben

      <Host name="localhost" 
               debug="0" 
               appBase="webapps"
               unpackWARs="true" 
               autoDeploy="true"  <<<--------<<<<<
               xmlValidation="false" 
               xmlNamespaceAware="false">





On Wednesday 10 December 2003 06:47 am, Adam Hardy wrote:
> On 12/10/2003 08:53 AM Kent Boogaart wrote:
> > Hi all,
> >
> > I am trying make my web application available via the default context. In
> > other words, when I type http://localhost:8080/ in a browser on the local
> > machine I want my web app to appear rather than the Tomcat default web
> > app.
> >
> > I figured I'd just need to alter my context's path to "" (empty string)
> > and alter the existing root context to use "/root" for it's path rather
> > than "". Whilst this kind of works (my web app is available via
> > http://localhost:8080/) it has an unfortunate side effect. My web app is
> > started up twice - once in the "" context and again in another context
> > based on my web app's name ("/eSM").
> >
> > How can I use the default context and only the default context for my web
> > app?
>
> You need to name your deploy directory 'ROOT' in CATALINA_HOME/webapps.
>
> Rename or delete the current ROOT.  Make sure there is no context xml
> config in conf/server.xml or conf/Catalina/localhost/*.xml with docbase
> ROOT apart from the one with path=''.
>
> Note I'm talking about 5.0.12 but I think it's pretty much the same for 4.x
>
> Adam

-- 
Ben Souther
F.W. Davison & Company, Inc.



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


Re: Default context for web app

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
On 12/10/2003 08:53 AM Kent Boogaart wrote:
> Hi all,
> 
> I am trying make my web application available via the default context. In
> other words, when I type http://localhost:8080/ in a browser on the local
> machine I want my web app to appear rather than the Tomcat default web app.
> 
> I figured I'd just need to alter my context's path to "" (empty string) and
> alter the existing root context to use "/root" for it's path rather than "".
> Whilst this kind of works (my web app is available via
> http://localhost:8080/) it has an unfortunate side effect. My web app is
> started up twice - once in the "" context and again in another context based
> on my web app's name ("/eSM").
> 
> How can I use the default context and only the default context for my web
> app?

You need to name your deploy directory 'ROOT' in CATALINA_HOME/webapps.

Rename or delete the current ROOT.  Make sure there is no context xml 
config in conf/server.xml or conf/Catalina/localhost/*.xml with docbase 
ROOT apart from the one with path=''.

Note I'm talking about 5.0.12 but I think it's pretty much the same for 4.x

Adam

-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian

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