Recent Posts
Archives

PostHeaderIcon Tomcat: How to deploy in root?

Case

You have a WAR to deploy on Tomcat, let’s say jonathan.war for instance. Usually, the application will be reached through the URL http://machine:port/jonathan.
Let’s say you would like to exclude the WAR name from the address, ie the application to be reached on http://machine:port/. This operation is called “to deploy in root”, since the context will be simple slash: '/'.

Solution

You can implement that with two means:

  • rename the war as ROOT.war, then deploy.
  • or: edit conf/server.xml, replace [xml]<context>[/xml] with
    [xml]<context path="" docBase="jonathan" debug="0" reloadable="true"> [/xml]

Leave a Reply