这里注意,在jakarta-tomcat-5.0.28.exe以前是有默认的admin模块,在jakarta-tomcat-5.5.9.exe则没
有安装默认的admin模块,这时http://127.0.0.1:8080/admin打开时则会出现 Tomcat's administration web application is no longer installed by default. Download and install the "admin" package to use it.
因此我们现在需要下载"admin"package 包, 把jakarta-tomcat-5.5.x.zip 与 jakarta-tomcat-5.5.x-compat.zip 与 jakarta-tomcat-5.5.x-admin.zip 三个文件解压在同一个目录中 (如果使用jdk1.4,才需
要compat.zip用jdk1.5就可以免了这个。)
2.修改jakarta-tomcat-5.5.x\conf\tomcat-users.xml.
添加管理员账号lizongbo,密码为lizongbopass.
新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="role1" password="tomcat" roles="role1"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="lizongbo" password="lizongbopass" roles="admin,manager"/>
</tomcat-users>
有时在%CATALINA_HOME%\server\webapps\admin\WEB-INF\web.xml里面也要做些修改
<!-- Security is active on entire directory -->
<security-constraint>
<display-name>Tomcat Server Configuration Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<!-- Define the context-relative URL(s) to be protected -->
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.do</url-pattern>
<url-pattern>*.html</url-pattern>
</web-resource-collection>
<auth-constraint>
<!-- Anyone with one of the listed roles may access this area -->
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<!-- Login configuration uses form-based authentication -->
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Tomcat Server Configuration Form-Based Authentication Area</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>
<!-- 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>
无论是 Authetication ( 身份验证 还是 Authorization ( 权限管控 都只有设置相关的 admin ROLE, 当
| 论坛热门帖子: | [lch203] 写得蛮好的linux学习笔记(10-21) [黑马制造] 学习java的30个目标(10-19) [笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19) [udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18) [沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18) |
| TAG标签: | 集锦 配置 tomcat mime-mapping 修改 jakarta-tomcat-5.5.x |
注册
个人空间
