问题
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