无法登陆Tomcat6,7,8,9 ?

前言

从Tomcat官网下载后,启动tomcat成功,但是可能无法登录。对于不同的版本,原因不一样。


3764710-56fcdba799f24864.png
image.png

Tomcat 6.x/7.x

1.编辑conf/tomcat-users.xml ,加入即可:

<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>

Tomcat 8.x/9.x

  1. 编辑 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" />
-->
  <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>

2.编辑conf/tomcat-users.xml ,加入即可:

<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>

翻译自: https://geekflare.com/tomcat-login-problem/

猜你喜欢

转载自blog.csdn.net/weixin_34049032/article/details/87111797
今日推荐