zoukankan      html  css  js  c++  java
  • 登入Tomcat Manager时出现401错误——解决方法

    要进入Tomcat Manager得先进行配置,进入tomcat解压目录->conf,对tomcat-users.xml进行修改。在这个文件中添加manager角色,并为管理员添加上这种角色即可

    <?xml version='1.0' encoding='utf-8'?>

    <tomcat-users>

      <role rolename="tomcat"/>
      <role rolename="role1"/>
      <role rolename="manager"/>   
      <user username="admin" password="admin" roles="manager"/>
      <user username="tomcat" password="tomcat" roles="tomcat"/>
      <user username="both" password="tomcat" roles="tomcat,role1"/>
      <user username="role1" password="tomcat" roles="role1"/>

    </tomcat-users>

    做了上面的改变如果还是有错误,请看下面:

    <tomcat-users>
    <!--
      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.
    -->
    <!--
      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.
    -->
    <!--
        <role rolename="tomcat"/>
      <role rolename="role1"/>
      <role rolename="manager"/>
     
      <user username="admin" password="admin" roles="manager"/>
      <user username="tomcat" password="tomcat" roles="tomcat"/>
      <user username="both" password="tomcat" roles="tomcat,role1"/>
      <user username="role1" password="tomcat" roles="role1"/>
    -->

    </tomcat-users>
    把红色的线去掉就可以了,因为<!-->所包括的东西是要被忽略的,相当于注释的作用!

    较高版本的使用admin-gui,不再是manager作为管理员权限

     <role rolename="admin-gui"/>

    <user username="tomcat" password="tomcat" roles="tomcat,admin-gui"/>

  • 相关阅读:
    高可用——Keepalived安装部署使用详解
    Java—File类详解及实践
    MySQL—设置数据库(库、表等)不区分大小写
    MySQL—Mysql与MariaDB启停命令的区别
    Linux—微服务启停shell脚本编写模板
    SpringBoot—集成AOP详解(面向切面编程Aspect)
    Java—Map集合详解
    手动搭建I/O网络通信框架1:Socket和ServerSocket入门实战,实现单聊
    Java高效编程:总结分享
    Redis的几种应用实战
  • 原文地址:https://www.cnblogs.com/linchaohao/p/4745129.html
Copyright © 2011-2022 走看看