tomcat管理界面登录无法进入

Bertha 。 2022-06-08 00:36 475阅读 0赞

问题:

在打开tomcat界面之后,点击Manger App准备进入管理界面,路径:http://localhost:8080/manager/html。 输入正确的用户名和密码,但是出现401界面。

准备如下
首先在 tomcat /conf/ tomcat-users.xml
中添加了

  1. <role rolename="manager-gui"/>
  2. <role rolename="manager-script"/>
  3. <role rolename="manager-jmx"/>
  4. <role rolename="manager-status"/>
  5. <user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status"/>

该配置,但是重启tomcat之后,输入正确的用户名和密码, 还是无法进入Manger App ,直接进入401.
这里写图片描述
这里写图片描述

解决办法:

  1. 被该问题困扰了很久,最后还是成功解决了,希望能帮到被次问题困扰的人。

1,重新下载tomcat安装版,我用的是解压版的,然后重新配置就好了。很是无语。

2,重新使用解压版的,将安装版的tomcat-users.xml 覆盖解压版的tomcat-users.xml,然后就好了。

这里写图片描述
完整的配置为:

  1. <!-- NOTE: By default, no user is included in the "manager-gui" role required to operate the "/manager/html" web application. If you wish to use this app, you must define such a user - the username and password are arbitrary. -->
  2. <!-- NOTE: The sample user and role entries below are wrapped in a comment and thus are ignored when reading this file. Do not forget to remove <!.. ..> that surrounds them. -->
  3. <role rolename="tomcat"/>
  4. <role rolename="role1"/>
  5. <role rolename="manager-gui"/>
  6. <user username="tomcat" password="tomcat" roles="tomcat,manager-gui"/>
  7. <user username="both" password="tomcat" roles="tomcat,role1"/>
  8. <user username="role1" password="tomcat" roles="role1"/>
  9. </tomcat-users>

可以直接复制上面的到 tomcat-users.xml 保存运行就可以了。

发表评论

表情:
评论列表 (有 0 条评论,475人围观)

还没有评论,来说两句吧...

相关阅读