Tag Archives: tomcat

Remove Tomcat application context from WEB URL .

Remove Tomcat application WEB URL without context or application name.
Like,
URL : linuxsysad.abc.com/tomcatapp

tomcatapp name is example of our tomcat application. (Don’t take seriously ).

What we are going to do ?
We changed web URL linuxsysad.abc.com/tomcatapp to linuxsysad.abc.com (Without tomcatapp application name).

Tested in Centos7
nginx
tomcat 9


No changes required in existing Nginx tomcat configuration file.

Changes required in server.xml in tomcat server directory.
Tomcat server configuration file path: /website_dir/tomcat/conf/server.xml

Open server.xml file in your feveroit editor and
find below lines, (Moslty line number 152)

<Host name=”localhost” appBase=”webapps”
unpackWARs=”true” autoDeploy=”true”>

replaced with below line. Kindly make sure change path as per your configuration or path.
put your hostname and tomcat webapp path.

<Host name=”linuxsysad.abc.com” debug=”1″>
<Context path=””
docBase=”/web/tomcat/webapps/tomcatapp”/>

Image is for reference only. Make sure proper script indentation, don’t do copy paste only.

Save & exit file.
Now restart tomcat service.

All done..!

← Back

Thank you for your response. ✨

Please rate our website(required)