`

tomcat8 启用管理页面 manager 遇到的坑

阅读更多

启用tomcat8的管理页面。按照网上配置 tomcat-user.xml 完成后,使用localhost 或者 127.0.0.0访问,都可以正常弹出验证框。但是用 ip地址 例如:171.1.1.2 死活不成功,根本都不弹出验证框。

 

坑在这里:::

 

webapps/manager/META-INF/context.xml 里  allow 属性

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

 改为

<Context antiResourceLocking="false" privileged="true" >
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="^.*$" />
  <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>

 

 

坑就是这个  allow属性

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics