- 添加配置文件
原配置文件:
# tail -5 /usr/local/tomcat/conf/tomcat-users.xml
<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"/>
-->
</tomcat-users>
添加后配置文件(红色是添加内容):
# tail -7 /usr/local/tomcat/conf/tomcat-users.xml
<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="admin-gui"/>
<user username="kazihuo" password="000000" roles="manager-gui,admin-gui"/>
</tomcat-users>
- 进入页面
- 进入配置页
问题描述
当访问Server Status、Manager App、Host Manager时出现403页面;
问题解决
修改访问配置即可解决,红色是修改内容;
原配置文件:
# tail -6 /usr/local/tomcat/webapps/host-manager/META-INF/context.xml
-->
<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 antiResourceLocking="false" privileged="true" >
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="192.168.1.*" />
<Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>
原文地址:https://www.cnblogs.com/kazihuo/p/8818266.html