Friday 29 January 2010

Deploy an application in context root on Tomcat


How to Deploy an application in context root on Tomcat?

Suppose my web application with name MyApp, I created a WAR file and deployed in Tomcat. Now you can access the application as http://localost:port/MyApp/…

How can you change the context root in URL to some thing else?

Solution

Very Simple ,

1. Go to Tomcat Installation dir/conf/server.xml

2. Under Add (or Edit if is already existing) See image for xmls

Now your URL will be http://localhost:port/

You can change path to anything you want

See image for xmls

3. AND remove the ROOT webapp, or it will use that instead.

No comments: