1. 程式人生 > >tomcat manager status配置

tomcat manager status配置


1. 確保tomcat下原來自帶的幾個專案未被刪掉,tomcat啟動時localhost:8080能直接訪問tomcat主頁

2. 修改tomcat下 conf/tomcat-users-xml檔案,找到tomcat-users標籤,按照下面的加上配置

        注: username: 使用者名稱, password:密碼   自己根據需求做修改

<tomcat-users xmlns="http://tomcat.apache.org/xml"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
              version="1.0">
        <role rolename="manager"/>
        <role rolename="manager-gui"/>
        <user username="admin" password="admin" roles="manager,manager-gui"/>
</tomcat-users>
3. 修改 tomcat/webapps/manager/META-INF/context.xml,註釋掉context標籤下的所有程式碼,否則會出現無訪問許可權的問題
<Context antiResourceLocking="false" privileged="true" >
<!--
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
  <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
-->
</Context>

4. 登入tomcat首頁,點選 Server Status 登入到管理介面