tags:

views:

7223

answers:

9

Hello,

I'm trying to change the default application of Tomcat 6 webserver to other application than "ROOT" (inside webapps folder).

I Tried googling around but couldn't find anything that works...

Any help is greatly appreciated.

Jacques

A: 

According to the Apache Tomcat docs, you can change the application by creating a ROOT.xml file. See this for more info:

http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

"The default web application may be defined by using a file called ROOT.xml."

Jon
A: 

I'll look at my docs; there's a way of specifying a configuration to change the path of the root web application away from ROOT (or ROOT.war), but it seems to have changed between Tomcat 5 and 6.

Found this:

http://www.nabble.com/Re:-Tomcat-6-and-ROOT-application...-td20017401.html

So, it seems that changing the root path (in ROOT.xml) is possible, but a bit broken -- you need to move your WAR outside of the auto-deployment directory. Mind if I ask why just renaming your file to ROOT.war isn't a workable solution?

Don Werve
Unfortunately changing the war file to ROOT.war is not an option for me.Jacques
Okay, but why? I'm curious.
Anonymouse
A: 

Jon, Don,

Thank you very much. I tried adding ROOT.xml to my {CATALINA_HOME}/conf/Catalina/localhost. I has the content

where webapps/RedWeb is the location of my root application, but it's still not working.

Any thought on this? Is this correct? Thank you

Jacques

Please edit your original question when you add/change something. This is not a forum.
Jan Jungnickel
A: 

Sorry there's typo on the last message. My ROOT.xml has this content

<?xml version="1.0" encoding="UTF-8"?>

<Context docBase="C:/Program Files/Apache Software Foundation/Tomcat 6.0.18 manual/webapps/RedWeb.war">
</Context>

RedWeb.war is the war file for my targeted web app. But this still not working.

Any thoughts on this? Thank you very much,

Jacques

A: 

You can do this in a slightly hack-y way by:

  1. Stop Tomcat
  2. Move ROOT.war aside and rm -rf webapps/ROOT
  3. Copy the webapp you want to webapps/ROOT.war
  4. Start Tomcat
gareth_bowles
*slightly* hacky?
skaffman
A: 

hi

you should change your server.xml file as below:

from .... to

  <Host name="localhost"  appBase="E:\struts-ITRCbook\myStrutsbook"
           ....

regards.

ze
I don't think that does what the OP is after ...
Joachim Sauer
appBase should never point to a single webapp.
nos
+2  A: 
ze
A: 

why it doesnt show my code in this forum?

ze
It should work... you can click the 101010 "code sample" button and then enter your code.
Jon
A: 

the code of server.xml in tomcat6 is:

ze