在centos7上安装了tomcat,能正常启动,但是点击Manager app报 403 Access Denied错误。
首先确保你已经在tomcat-users文件中添加了类似的如下内容:
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
如果已经添加了,那种就是下面这种原因造成的了。
By default the Manager is only accessible from a browser running on the same machine as Tomcat. If you wish to modify this restriction, you'll need to edit the Manager's context.xml file.
需要修改tomcat下的webapps\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" /> -->
</Context>
把里面的value节点注释掉再重启tomcat就行了。
下面有tomcat官方解释:
http://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html#Configuring_Manager_Application_Access