By Tanvir Shuvo
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:
http://myDomain:8080/MyWebApp/myWebApp
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'?>
<Context>
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
path="" docBase="MyWebApp" debug="0" reloadable="true"
</Context>
Any help would be very much appreciated!
Thank you in advance!
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!
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:
- cd /var/lib/tomcat7/webapps
- wget https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/sample.war
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.