tomcat管理模块报401 Unauthorized

进入tomcat,点击管理模块(Manager App)或者查看服务器状态(Server Status),提示401 Unauthorized

提示如下页面

 

 

 

原因是tomat默认没有配置角色和用户,按照提示页面进行配置即可

打开tomcat安装目录,进入到conf\tomact_user.xml 

<tomcat-users>
  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <user username="tomcat" password="tomcat" roles="manager-gui"/>
  <user username="admin" password="123456" roles="manager-script"/>
</tomcat-users>

重启tomat服务,使用admin登录即可

角色说明:

manager-gui
允许访问html接口(即URL路径为/manager/html/*)
manager-script
允许访问纯文本接口(即URL路径为/manager/text/*)
manager-jmx
允许访问JMX代理接口(即URL路径为/manager/jmxproxy/*)
manager-status

 

posted @ 2020-02-10 11:34  zhuitian  阅读(2101)  评论(0编辑  收藏  举报