启动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了。