Tomcat Manager Configuration

Source: Internet
Author: User

Tomcat Manager is a web app that Tomcat comes with to manage the tomcat itself and the apps that are deployed on Tomcat. Tomcat is one of the most widely used servers in the Java world, so Tomcat manager has become a very common feature application.

By default, Tomcat Manager is in a disabled state. To be precise, the Tomcat manager needs to be logged in as a user role and authorized to use the appropriate functionality, but Tomcat does not configure any default users, so we need to make the appropriate user configuration before using Tomcat Manager.

The user configuration of the Tomcat manager is managed in a Tomcat安装目录/conf/tomcat-users.xml file.

The user configuration of the Tomcat manager is very simple, let's take a specific configuration as an example:

<tomcat-users>
<role RoleName="Manager-gui"/>
<role RoleName="Manager-script"/>
<user username = "tomcat" password= roles=" Manager-gui " />
<user Username= "admin" Password= "123456" roles = "manager-script" />
</TOMCAT-USERS>

As shown above, we only need to tomcat-users configure the appropriate role (roles/permissions) and user (users) in the node. A user node represents a single user, a property, username and a password user name and password that represents a login, and the attribute roles represents the permissions that the user has.

userThe attribute value of the node roles role corresponds to the node's rolename property value, which indicates that the current user has the role permissions represented by that role node. Of course, a user can have a variety of permissions, so roles the value of the property can be multiple rolename , multiple rolename separated by commas.

Thinking a little bit, we should guess that rolename the attribute value is not random content, or how Tomcat can know rolename what kind of permissions we arbitrarily define. In fact, Tomcat has defined 4 different roles for us-that is rolename , 4, and we just need to use the roles that Tomcat has defined for us to meet the needs of our work.

The following is a general introduction to the 4 roles of the Tomcat Manager (the * in the following URL is a wildcard character):

Manager-gui
Allow access to HTML interface (that is, URL path is/manager/html/*)
Manager-script
Allow access to the plain text interface (that is, URL path is/manager/text/*)
Manager-jmx
Allow access to the JMX proxy interface (that is, URL path is/manager/jmxproxy/*)
Manager-status
allow access to Tomcat read-only status pages (that is, URL path is/manager/status/*)

From the Tomcat manager internal configuration file, you can know,, and manager-gui manager-script manager-jmx all manager-status of the permissions, that is,, manager-gui manager-script manager-jmx three role permissions without adding additional manager-status permissions, can directly access the path /manager/status/*.

Tomcat Manager Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.