Tomcat 8系列笔记:配置管理主页(status、manager app、host manager)

本文介绍如何解决Tomcat管理控制台403错误的问题,包括配置用户权限、修改content.xml文件及设置IP访问白名单的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

启动tomcat后,会进入如下页面进入tomcat管理控制台。

如果没有配置tomcat-users,点击Server Status、Manager APP、Host Manager 出现403。

文件内容如下,需要添加user到该文件中,即可。正常文件,该部分是注释掉的。

 <role rolename="manager-gui"/>    
 <role rolename="manager-script"/>    
 <role rolename="manager-jmx"/>    
 <role rolename="manager-status"/>     
 <role rolename="admin-script"/>    
 <role rolename="admin-gui"/>    
  
 <user username="tomcat" password="tomcat" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>   

Manager的管理角色:

manager-gui - allows access to the HTML GUI and the status pages

manager-script - allows access to the text interface and the status pages

manager-jmx - allows access to the JMX proxy and the status pages

manager-status - allows access to the status pages only

 

正常启动,登录用户名密码后进入:

根据上图,可以进行监控台关注,解释一下各指标的含义:

Status-JVM

  • Free memory:剩余内存;
  • Total menory:总内存;
  • Max menory:最大内存。

Status-HTTP

  • Max threads:最大线程数;
  • Current thread count:当前线程数;
  • Current thread busy:当前忙碌线程数;
  • Max processing time:最大处理时间;
  • ms Processing time:最短处理时间;
  • Request count:请求数;
  • Error count:错误数;
  • Bytes received:接受字节;
  • Bytes sent:发送字节。

如果点击提示403页,则需要修改host-manager和manager下的content.xml文件。

content.xml内容:

更改一下IP访问白名单:

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />

OK了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值