Java environment configuration-configure tomcat users and tomcat users in java environment
Tomcat Manager is a web application that comes with Tomcat and is used to manage Tomcat itself and applications deployed on Tomcat. Tomcat is one of the most widely used servers in the Java field. Therefore, Tomcat Manager has become a widely used function application.
By default, Tomcat Manager is disabled. Tomcat Manager must be logged on and authorized as a user role to use the corresponding functions. However, Tomcat does not have any default users. Therefore, Tomcat Manager can be used only after the corresponding user configuration is performed.
The user configuration of Tomcat Manager is inTomcat installation directory/conf/tomcat-users.xml
File.
The following configuration is used to configure tomcat user app management and publishing.
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>
<user username="admin" password="admin" roles="manager-script"/>
</tomcat-users>
The following describes the four roles of Tomcat Manager (* is a wildcard in the URL below ):
-
Manager-gui
-
Allow access to the html interface (that is, the URL path is/manager/html /*)
-
Manager-script
-
Allow access to the plain text interface (that is, the URL path is/manager/text /*)
-
Manager-jmx
-
Allow access to the JMX proxy interface (that is, the URL path is/manager/jmxproxy /*)
-
Manager-status
-
Allow access to the Tomcat read-only status page (that is, the URL path is/manager/status /*)