How to change Tomcat manager default path ?
By default, Tomcat’s manager webapp is able to access via yourapp:8080/manager. It is a good practice to change the default /manager to something else, to avoid potential brute force attack.
Environment
- Tomcat 7 (apt-get install)
- Debian 7.5
1. Solution
This article show you how to change / rename the default manager webapp path from “/manager” to “/manager123”.
# Tomcat manager webapp /usr/share/tomcat7-admin/manager # Tomcat conf manager.xml /var/lib/tomcat7/conf/Catalina/localhost/manager.xml
1.1 Rename Tomcat manager folder
Rename “manager” folder to a new folder name “manager123”, from /usr/share/tomcat7-admin/manager to /usr/share/tomcat7-admin/manager123
$ pwd /usr/share/tomcat7-admin $ sudo mv manager manager123
1.2 Update docBase in manager.xml
Update “docBase” in “manager.xml” and points it to the new renamed manager folder, “manager123”.
<Context path="/manager" docBase="/usr/share/tomcat7-admin/manager123" antiResourceLocking="false" privileged="true" />
1.3 Rename manager.xml
Rename “manager.xml” to “manager123.xml”, from /var/lib/tomcat7/conf/Catalina/localhost/manager.xml to /var/lib/tomcat7/conf/Catalina/localhost/manager123.xml
$ pwd /var/lib/tomcat7/conf/Catalina/localhost $ sudo mv manager.xml manager123.xml
1.4 Restart Tomcat
Done, restart Tomcat.
$ sudo service tomcat7 restart
Now, the Tomcat manager webapp path is changed to “/manager123”.
From:一号门
COMMENTS