用自解压方式安装Tomcat5, 在startup.bat中指定JDK.
手工编辑tomcat-users.xml文件:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="manager" password="manager" roles="manager"/>
<user username="admin" password="admin" roles="admin"/>
</tomcat-users>
这样就能进入admin或manager了.
因为这两部分TOMCAT自带的管理控制台均使用容器权限管理方式, 可注意其web.xml中如下设置:
<security-role>
<description>
The role that is required to log in to the Manager Application
</description>
<role-name>manager</role-name>
</security-role>
在该文件中就指定的只有manager角色方可使用该应用.
admin应用中与之类似:
<!-- Security roles referenced by this web application -->
<security-role>
<description>
The role that is required to log in to the Administration Application
</description>
<role-name>admin</role-name>
</security-role>
Trackback: http://tb.donews.net/TrackBack.aspx?PostId=431320