ITeye博客

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

45571845 · 2018-12-20 15:55 · 编程常见问题 · 技巧积累 · 开源软件 · Markdown

启用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属性

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。