Modifying the context root of the server
After you install the server, you can modify the context root, if your server configuration requires it.
Procedure
- Stop the server.
- From the server installation directory, rename the directory server_install/opt/tomcat/webapps/ROOT to
a new name, such as server_install/opt/tomcat/webapps/deploy
Use the server installation directory for
server_install
. - Make a backup copy of the file opt/tomcat/conf/server.xml.
- Open the file opt/tomcat/conf/server.xml in a text editor
- In the server.xml file, find the following
line of code:
<Context path="" docBase="ROOT" debug="0" reloadable="false" useHttpOnly="true" sessionCookieName="JSESSIONID_8080">
- In this code, change both the docBase attribute
and the path attribute to the name of the new
folder.For example, if you renamed the ROOT folder to deploy, the code looks like the following example:
<Context path="deploy" docBase="deploy" debug="0" reloadable="false" useHttpOnly="true" sessionCookieName="JSESSIONID_8080">
- Save the file.
- Restart the server.
Results
https://hostname:port/foldername
Use
the new name of the folder as foldername
.