Tomcat management feature uses

Tomcat Tomcat management functions for applications deployed on their own as well as the Tomcat for web application management, default is in the disabled state. (Page management report 403 errors, first, because validate the user name and password, and second, because authorization is disabled address)

If you need to turn on this feature, you need to configure user management, namely configure tomcat-users.xml file.

[root@localhost ~]# vim /usr/local/tomcat8/conf/tomcat-users.xml
  <role rolename="manager-gui"/>
  <role rolename="admin-gui"/>
  <user username="tomcat" password="tomcat" roles="manager-gui,admin-gui"/>
</tomcat-users>

还需要注释掉地址
[root@localhost ~]# vim /usr/local/tomcat8/webapps/manager/META-INF/context.xml
<!--  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> -->

Then restart Tomcat

[root@localhost ~]# /usr/local/tomcat8/bin/shutdown.sh 
[root@localhost ~]# /usr/local/tomcat8/bin/startup.sh

 PS: test function, the production environment is disabled

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/2567xl/p/11574283.html
Recommended