How to set up tomcat context path for web application? .war file name is coming infront of the application name in the url.

I am having a trouble getting my web application ‘xyz’ running at:


The name of my .war file is “.MyWebApp”.

after deploying the .war file in tomcat, the application starts at:


any idea how to remove this “MyWebApp” part from the URL?

I have seen some of the solutions for this problem, they are mostly solutions of running the application in localhost. They suggested to change the ‘context.xml’ file which I already did like this:

<?xml version='1.0' encoding='utf-8'?>

    <!-- Default set of monitored resources -->

     path="" docBase="MyWebApp" debug="0" reloadable="true"

Any help would be very much appreciated!

Thank you in advance!

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Without knowing more information about the structure of your application, it’s difficult to provide a thorough answer to your question. On Ubuntu 14.04 with a standard Tomcat 7 installation, placing a war file in the CATALINA_BASE directory should accomplish what you want. For instance, let’s use the Tomcat “hello world” war:

  1. cd /var/lib/tomcat7/webapps
  2. wget

Now browsing to http://your.ip.addr:8080/sample will display the application. If you want to remove the app name from the path completely, you can rename the war file to ROOT.war