1. Modify the $tomcat_home/webapps/manager/meta-inf/context.xml file to allow IP access to the manager service
<?xml version= "1.0" encoding= "UTF-8"?> <!--licensed to the Apache Software Foundation (ASF) under one or more Contributor license agreements.
The NOTICE file distributed with this work for additional information regarding copyright. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); You are not to use this file except in compliance with the License. Obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 unless required by applicable Agreed to writing, software distributed under the License was distributed on ' as is ' basis, without Warra
Nties or CONDITIONS of any KIND, either express OR implied.
The License for the specific language governing permissions and limitations under the License. --> <context antiresourcelocking= "false" privileged= "true" > <valve classname= " Org.apache.catalina.valves.RemoteAddrValve "allow=" ^.*$ "/> </context>
2. Modify $tomcat_home/conf/tomcat-users.xml file, configure username and password
<?xml version= "1.0" encoding= "UTF-8"?> <!--licensed to the Apache Software Foundation (ASF) under one or more Contributor license agreements.
The NOTICE file distributed with this work for additional information regarding copyright. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); You are not to use this file except in compliance with the License. Obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 unless required by applicable Agreed to writing, software distributed under the License was distributed on ' as is ' basis, without Warra
Nties or CONDITIONS of any KIND, either express OR implied.
The License for the specific language governing permissions and limitations under the License. --> <tomcat-users xmlns= "Http://tomcat.apache.org/xml" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-ins" Tance "xsi:schemalocation=" http:Tomcat.apache.org/xml tomcat-users.xsd "version=" 1.0 "> <!--note:by default, no user is included In the ' Manager-gui ' required to operate the '/manager/html ' Web application. If you are wish to use this app, you must define such a user-the username and password are. It is strongly recommended ' you don't use one of the ' users in the ' commented out section below since they are inte
Nded for use with the examples Web application. --> <!--note:the Sample user and role entries below are intended to the examples Web application. They are wrapped in a comment and thus are ignored when reading this file. If you are wish to configure the examples Web application, does not forget to remove the <!.. .. > that surrounds them.
You'll also need to set the passwords to something appropriate. --> <!--<role rolename= "Tomcat"/> <role rolename= "role1"/> <user username= "toMCAT "password=" <must-be-changed> "roles=" Tomcat "/> <user username=" Both "password=" <must-be-changed > "roles=" tomcat,role1 "/> <user username=" role1 "password=" <must-be-changed> "roles=" Role1 "/>" > <role rolename= "Manager-gui"/> <role rolename= "manager-status"/> <role "rolename=" /> <user username= "admin" password= "123456" roles= "Manager-gui, mananger-status"/> </tomcat-users>
Reboot Tomcat, OK.