Sunday 8 January 2012

Tomcat: change the default ROOT "/" web application

I have copied foo.war into webapps. I want to access it when I request the URL http://localhost:8080/ (not I can access it on http://localhost:8080/foo/) Edit /etc/tomcat6/server.xml
<Host ...>
   <Context path="" docBase="foo" debug="0" reloadable="true">
   </Context>
</Host>

How it should be..not working!

OK..I don't like this invasive way of editing server.xml. There is another way that didn't work for me (why?anybody?)

Edit /etc/tomcat6/Catalina/localhost/ROOT.xml:
<Context path="/"                                                                                                                                                              
         docBase="/foo.war"                                                                                                                                                 
         reloadable="true"                                                                                                                                                     
         antiResourceLocking="false" />

References

http://techlightening.wordpress.com/2009/05/13/tomcat-change-default-web-application/

No comments:

Post a Comment