zoukankan      html  css  js  c++  java
  • tomcat使用manager管理app时需要身份验证问题

    我们可以通过图形用户界面来管理tomcat,启动tomcat,在地址栏中输入:

    Java代码

    1. http://localhost:8080

    就可以看见tomcat的欢迎页面,点击左边的tomcat manager 就会出现一个对话框,需要输入用户名和密码,当忘记最开始安装tomcat时的用户名和密码时,我们可以通过以下方杰来解决: 
    修改tomcat-users.xml文件,这个文件在tomcat的安装目录下的conf目录下,打开这个文件,我们可以看到如下信息:

    Java代码

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

    我们在这里加上如下的一句话:

    Java代码

    1. <user username="admin" password="admin" roles="admin,manager"/>

    修改后的文件为:

    Java代码

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

    重新启动tomcat服务器,这时,我们就可以使用用户名为admin,密码为admin的用户登录tomcat的管理界面了,这样,我们可以远程管理tomcat了

    tomcat7 请添加如下文件:

    <role rolename="manager-gui"/>
      <role rolename="admin-gui"/>
      
      <user username="admin" password="admin" roles="manager-gui,admin-gui"/>
  • 相关阅读:
    深度解读设备的“万能语言”鸿蒙系统的分布式软总线能力
    懂分析、会预测,你见过这样的华为云DAS吗?
    华为云登顶HotpotQA多跳知识推理问答评测
    突破开源Redis的内存限制,存算分离的GaussDB到底有多能“装”?
    六步带你完成博流wifi模组对接华为云流程
    Materialize MySQL引擎:MySQL到Click House的高速公路
    CWE 4.3:强化你的数据自我保护能力
    使用TENSORRT和NVIDIA-DOCKER部署深部神经网络
    用于ONNX的TensorRT后端
    循环IRNNv2Layer实现
  • 原文地址:https://www.cnblogs.com/tnsay/p/5977550.html
Copyright © 2011-2022 走看看