Kishore Tamire
Kishore Tamire

Reputation: 2094

Tomcat context path change for accessing the app from root

We have tomcat 5.5.25. There are around 10 war files deployed in this tomcat.

All the war files are in a separate directory, and we have xml files for each app in conf/catalina/localhost folder.

For example take app.war application

app.war file is present in a /tomcat/apps directory.

app.xml file present in conf/catalina/localhost folder.

and exploded directory is present in webapps folder.

app.xml file looks like this

<Context path="/app"docBase="/tomcat/apps/app.war">
</Context>

and this application is accessible using url

http://mytomcat:8080/app

Now My requirement is to access the application directly using the url

http://mytomcat:8080/

To achieve this what configurations do I need to change? please help

Upvotes: 0

Views: 764

Answers (2)

morisil
morisil

Reputation: 1355

Rename app.xml to ROOT.xml in the conf/catalina/localhost folder and change the file into:

<Context
  path=""
  docBase="/tomcat/apps/app.war">
</Context>

Upvotes: 2

Michael Piefel
Michael Piefel

Reputation: 19998

Context path must be mapped to "/". convention is to call the web app at the root folder ROOT, and Tomcat will deploy a web app of that name to root if you let Tomcat auto-deploy.

Upvotes: 0

Related Questions