/apache-tomcat-6.0.35/conf/tomcat-users.xml 配置文件,使用时需要把注释去掉<!--
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>
-->
默认情况下 tomcat 输入管理员用户名密码是无法登陆的,apache官网文档说
To enable access to the Manager web application, you must either create a new username/password combination
and associate on of the manager roles with it, or add a manager role to some existing username/password combination.
There are four roles defined by the manager application:
* manager-gui - Allows access to the html interface
* manager-script - Allows access to the plain text interface
* manager-jmx - Allows access to the JMX proxy interface
* manager-status - Allows access to the read-only status pages
所以要自己创建一种角色和一个用户名才能登陆tomcat管理端
可以根据自己的需要来创建管理端角色,我创建了一个manager-gui的角色,并分给tom用户manager-gui角色,
<role rolename="tomcat"/>
<role rolename="manager-gui"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="tom" password="tomcat" roles="manager-gui"/>
</tomcat-users>
重启服务后,顺利登陆管理端!