想在Tomcat6安裝Admin模組,發現Tomcat6不再集成Administration Web Application,
看一些google上文章說可以用Tomcat5 Administration Web Application綜合起來配置
方法:
下載Tomcat5的Admin模組,解壓後把
1. conf/Catalina/localhost的admin.xml複製到Tomcat6下conf/Catalina/localhost
2. 把server/webapps下的admin目錄複製到Tomcat6下的webapps目錄下
3. 下載缺少的庫文件
commons-logging-1.1.jar
commons-logging-adapters-1.1.jar
commons-logging-api-1.1.jar
commons-modeler-2.0.1.jar
log4j-1.2.15.jar
放入Tomcat6下lib目錄
4.修改 conf/Catalina/localhost/admin.xml
<Context docBase="${catalina.home}/webapps/admin" privileged="true" antiResourceLocking="false" antiJARLocking="false">
5.在conf/tomcat-users.xml中加入如下代碼:
<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="admin" password="admin" roles="admin,manager"/>
</tomcat-users>
重啟server,在url上打 http://localhost:8080/admin 就可以看到了