长时间不碰中间件,又忘记了,还得重头搞起~~还是总结出来为妙~~

Server Status和Manager App对应../webapps/manager;Host Manager对应../webapps/host-manager。
默认情况下,这三个菜单是禁止的。如果点击的话,会报403错误:

1、启用控制台(对应如上红框的二、三处)
在conf/tomcat-users.xml中的<tomcat-users>标签里添加用户名、密码,并设置角色(其中manager-gui角色用以登录Server Status和Manager App而admin用以登录Host Manager):
<role rolename="manager-gui"/>
<role rolename="admin-gui" />
<user username="admin" password="abcd1234" roles="manager-gui,admin-gui" />
<user username="tomcat" password="s3cret" roles="manager-gui"/>
2、启用远程机器访问控制台(对应如上红框的一处)
即使添加了用户名密码tomcat默认也只允许从本机登录控制台(而且URL中IP要是127.0.0.1)。
未允许的IP访问控制台一般重定向报以下错误:
By default the Host Manager is only accessible from a browser running on the same machine as Tomcat. If you wish to modify this restriction, you'll need to edit the Manager's context.xml file.
要允许远程访问控制台,到webapps/manager/META-INF/context.xml(Host Manager到webapps/host-manager/META-INF/context.xml修改)将如下内容注释掉(合作和追加IP地址也可以):
