博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
tomcat用户设置
阅读量:7050 次
发布时间:2019-06-28

本文共 1091 字,大约阅读时间需要 3 分钟。

进入tomcat主页,会看到

点击Manager App会让你输入用户名和密码,该用户名和密码是要在conf目录中的tomcat-users.xml中配置的

打开tomcat-users.xml,在<tomcat-users>标签下添加如下配置

<role rolename="tomcat"/>

<!--<role rolename="manager"/>
<role rolename="admin"/>-->
<user username="test" password="test" roles="tomcat"/>

<user>标签中的用户名和密码就是需要输入的用户名和密码

但是这样配置是不够的,还需要在webapp/manager/WEB-INF/web.xml中的

配置中进行修改

  <security-constraint>

    <web-resource-collection>
      <web-resource-name>HTML Manager interface (for humans)</web-resource-name>
      <url-pattern>/html/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
       <role-name>tomcat</role-name>//需要修改的地方
    </auth-constraint>
  </security-constraint>

 

 <auth-constraint>

       <role-name>tomcat</role-name>//需要修改的地方
       <role-name>manager-script</role-name>
       <role-name>manager-jmx</role-name>
       <role-name>manager-status</role-name>
    </auth-constraint>

 

 <security-role>

    <description>
      The role that is required to access the HTML Manager pages
    </description>
    <role-name>tomcat</role-name>//需要修改的地方
  </security-role>

这样修改之后就可以用了

如果觉得文章写的还不错,那么就评论一下吧,有问题的话可以留言!!!

转载于:https://www.cnblogs.com/esten/archive/2012/09/11/2680011.html

你可能感兴趣的文章
openfire invalid sid 404
查看>>
开源一款私藏Management Studio插件,ProjkyAddin,送给所有使用SQLServer的园友们
查看>>
jQuery判断checkbox是否选中的3种方法
查看>>
在sublime Text 3上编写并运行java程序
查看>>
LinkedList源码分析
查看>>
【算法介绍】哈希排序算法
查看>>
js数组操作(增、删、改、查)
查看>>
UpdatePanel and JQuery Plugin
查看>>
centos5.7下的kdump
查看>>
[JavaEE笔记]Cookie
查看>>
【HDOJ】1987 Decoding
查看>>
ELK+Filebeat (1)
查看>>
leetcode 443. String Compression
查看>>
在没联网环境下,启动tomcat出错
查看>>
关于Git bash-127.0.0.7:8888拒绝访问的小问题--环境变量
查看>>
Java EE(七)
查看>>
javascript变量声明提升(hoisting)
查看>>
有价值的数据
查看>>
LayUi超级好用的前端工具
查看>>
[Ubuntu] ubuntu的tty下挂载移动硬盘拷贝数据
查看>>