TOMCAT8 and above configure manager access rights

Source: Internet
Author: User

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.

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.