Tomcat manager that comes with our Java hosting provides a few tools to help manage your webapps such as deploying new apps and checking status.
Tomcat versions up to version 6
For Tomcat 6 all you need to do is configure your tomcat/conf/tomcat-users.xml with the following:
<?xml version="1.0" encoding="UTF-8"?> <role rolename="manager"/> <user username="SOMEUSER" password="YOURPASS" roles="manager"/>
Then restart tomcat and access manager in browser: http://yourdomain.com/manager/html
Tomcat versions 7 and up.
As of Tomcat 7 some things changed to increase tomcat security. When editing the tomcat-users.xml file you need to use existing file and leave the tomcat-users xmlns information as is and simply add:
<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" version="1.0">
<role rolename="manager-gui"/> <user username="SOMEUSER" password="YOURPASS" roles="manager-gui"/>
Please note that manager is now manager-gui instead of just manager. There are several different manager types:
- manager-gui
- manager-script
- manager-status
- manager-jmx
Last step - Allowing Access
By default the Host Manager is only accessible from a browser running on the same machine as Tomcat. If you wish to modify this restriction, you'll need to edit tomcat/webapps/manager/META-INF/context.xml to allow all ips or just yours.
Below configuration is for allowing all IPs to access the manager:
Replace
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1"
with
allow=".*"
Example:
<Context antiResourceLocking="false" privileged="true" > <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow=".*" /> </Context>
Finally - restart tomcat and then navigate to yourdomain.com/manager/html
For more information please see the apache tomcat documentation: http://tomcat.apache.org/tomcat-8.5-doc/manager-howto.html