Tomcat 8.5 - 403 Access Denied

為{幸葍}努か 提交于 2021-02-08 07:03:32

问题


I've created a virtual machine with Ubuntu 16.04 LTS and, following this guide, I've installed Tomcat 8.5 and configured as follows:

/opt/tomcat/webapps/host-manager/META-INF/context.xml:

<Context antiResourceLocking="false" privileged="true">
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="192\.168\.1\.124|127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />    
</Context>
<!-- my local ip is 192.168.1.124 so I've added it -->

/opt/tomcat/conf/tomcat-users.xml

<role rolename="manager-gui" />
<role rolename="admin-gui" />
<user username="myuser" password="MyPass123#" roles="manager-gui,admin-gui" />

No other configuration files has been modified.

The problem comes out when I try to access to the manager interface from my browser, it doesn't ask me any kind of credentials and throws me a 403 (Access Denied) error.

How can I fix this problem?


回答1:


This is worked for me. Please check Find the CATALINA_HOME/webapps/manager/META-INF/context.xml file and add the comment markers around the Valve.

<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" />
-->
</Context>

Tomcat8 Documentation.



来源:https://stackoverflow.com/questions/40503771/tomcat-8-5-403-access-denied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!