How to use your webapp instead of ROOT or /folder in URL Print

  • 253

If you have a webapp that you have uploaded to the webapps directory in Tomcat and you wish to have your Tomcat hosting (check out our Java plans) use that webapp with your domain instead of ROOT then all you need to do is uncomment and update a context in your tomcat/conf/server.xml file.

Open the file and scroll to the bottom until you see the following:

At the bottom of your server.xml is a commented out context.

<!--
<Context path="/" debug="0" privileged="true"
docBase="/home/{username}/{yourdomain.com}/tomcat/webapps/{WEBAPPNAME}">
</Context>
-->

Remove the comments before and after and change WEBAPPNAME to the exact name of your webapp folder.

Then restart your Tomcat container. Once done, yourdomain.com in the url will load your webapp.

If your server.xml does not contain the above code, simply copy and paste and replace username, domain and webappname with yours in a new line after the <Alias>www.yourdomain.com</Alias>.


Was this answer helpful?

« Back