Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9989883
  • 博文数量: 1669
  • 博客积分: 16831
  • 博客等级: 上将
  • 技术积分: 12594
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-25 07:23
个人简介

柔中带刚,刚中带柔,淫荡中富含柔和,刚猛中荡漾风骚,无坚不摧,无孔不入!

文章分类

全部博文(1669)

文章存档

2023年(4)

2022年(1)

2021年(10)

2020年(24)

2019年(4)

2018年(19)

2017年(66)

2016年(60)

2015年(49)

2014年(201)

2013年(221)

2012年(638)

2011年(372)

分类: 系统运维

2012-10-25 09:40:15

Tomcat6.0以后版本中配置admin管理 + manger和host-manager两个项目,点击进入时报错“HTTP Status 404 - /host-manager/”或者“HTTP Status 404 - /manager/”  

2012-10-23 10:19:37|  分类: apache_tomcat |  标签: |字号 

Tomcat 5.5 以后的binary 核心安装版不再集成Tomcat Administration Web Application,需要独立下载安装。不过在网上查到可以使用Tomcat 5.5 的Administration Web Application在Tomcat 6.0.26下配置成功。现以Tomcat 6.0.26的Administration Web Application的配置为例,现将配置过程写出,希望对各位朋友有所帮助,如有纰漏,还请多多指教。过程如下:

一、下载apache-tomcat-6.0.26
下载地址:

 

解压到磁盘,如:D:\apache-tomcat-6.0.26

二、下载Tomcat 5.5.29 的admin application:
下载地址:



将解压后的conf和server文件夹覆盖到D:\apache-tomcat-6.0.26

三、下载Apache Commons Modeler,Logging组件,解压后将commons-modeler-XXX.jar

、commons-logging-XXX.jar拷贝到Tomcat 6.0.26安装目录下的lib目录中。

1.commons-modeler下载地址:


2.commons-logging下载地址:

 

四、配置$CATALINA_HOME/conf/tomcat-users.xml.配置如下:

 


  
  
  

 

注意:这里需要配置两个角色,admin角色负责管理,manager角色负责管理。


五、重启Tomcat,在浏览器中输入,如果能看到 Tomcat

Web Server Administration Tool 的登录界面,即安装成功。若不成功,可以查看

Tomcat 6.0.26安装目录下logs目录里的日志文件如(admin.2007-12-14.log),看看是出了什么问题。


manger和host-manager两个项目,点击进入时报错“HTTP Status 404 - /host-manager/”或者“HTTP Status 404 - /manager/”

今天在配置tomcat6.0.35中遇到了几个问题,总结如下以将遇到同样问题可以回顾:


      1、启动tomcat6.0.35后点击进入界面,包含有manger和host-manager两个项目,点击进入时报错“HTTP Status 404 - /host-manager/”或者“HTTP Status 404 - /manager/”

      解决:网上查找资料才知道Tomcat 5.5 以后的binary核心安装版不再集成Tomcat Administration Web Application需要自己下载,但tomcat6.0.X又没有对应的adminstrator包,解决方案参见“ ”(相关包在附件中)


      2、我的eclipse中没有安装tomcat插件,因此在eclipse中启动tomcat后进入时总是提示404错误,网上找了很久都不得原因。

      解决:后来终于在同事的帮助下发现我的eclipse中的“server location选项”错误(未命名.jpg),选择中“use tomcat install”才能成功发布到"work\Catalina\localhost"文件夹下。猜测:项目在启动tomcat服务器后发布到tomcat中,但我选择了“use workspace metadata”,所以发到workspace中,但没安装插件则没有成功,安装插件后估计后成功。

 

      3、顺便贴上几种发布方法和一些相关部署网址

      http://blog.csdn.net/blueseesea/article/details/2063313

     

 

 Tomcat6.0以后版本中配置admin管理 + manger和host-manager两个项目,点击进入时报错“HTTP Status 404 - /host-manager/”或者“HTTP Status 404 - /manager/” - zhuzhu - 五事九思 (大连Linux主机维护)

 
  •  (2.3 MB)
  • 下载次数: 0
  •  (1 MB)
  • 下载次数: 0
  •  (1004.2 KB)
  • 下载次数: 0
  •  (5.8 MB)
  • 下载次数: 0


Tomcat 7 访问 Manager 和 Host Manager

配置好 Tomcat 7.0 后,在 tomcat-users.xml 中配置用户角色来访问 localhost:8080 的这样三个按钮总出现问题:

  • Server Status
  • Manager App
  • Host Manager

要么是三个都不能访问,要么是只能访问其中一个,或者两个。

后来发现是角色没有添加全,特别是针对第三个按钮“Host Manager”

其实解决点在这样两个症结上:

  • 前两个按钮和manager相关,具体角色名为
    • manager-gui – allows access to the HTML GUI and the status pages
    • manager-script – allows access to the text interface and the status pages
    • manager-jmx – allows access to the JMX proxy and the status pages
    • manager-status – allows access to the status pages only
  • 第三个按钮和admin相关,具体角色名为
    • admin-gui – allows access to the HTML GUI and the status pages
    • admin-script – allows access to the text interface and the status pages

所以在 tomcat-users.xml 如果不注重安全性,只是测试用的话,对应部分可以简单地写成下面这个样子:

———————————







———————————

很多网页没说到第三个按钮针对的角色。不添加admin-gui和admin-script的话,第三个按钮就会出现访问被拒绝的问题(access denied ….)。

详细说明可以参考 Tomcat 的文档():

The Manager application has been re-structured for Tomcat 7 onwards and some URLs have changed. All URLs used to access the Manager application should now start with one of the following options:

  • /html for the HTML GUI
  • /text for the text interface
  • /jmxproxy for the JMX proxy
  • /status for the status pages

Note that the URL for the text interface has changed from “” to “/text”.

The roles required to use the Manager application were changed from the singlemanager role to the following four roles. You will need to assign the role(s) required for the functionality you wish to access.

  • manager-gui – allows access to the HTML GUI and the status pages
  • manager-script – allows access to the text interface and the status pages
  • manager-jmx – allows access to the JMX proxy and the status pages
  • manager-status – allows access to the status pages only

The HTML interface is protected against CSRF but the text and JMX interfaces are not. To maintain the CSRF protection:

  • users with the manager-gui role should not be granted either the manager-scriptor manager-jmx roles.
  • if the text or jmx interfaces are accessed through a browser (e.g. for testing since these interfaces are intended for tools not humans) then the browser must be closed afterwards to terminate the session.

The roles command has been removed from the Manager application since it did not work with the default configuration and most Realms do not support providing a list of roles.

The Host Manager application has been re-structured for Tomcat 7 onwards and some URLs have changed. All URLs used to access the Host Manager application should now start with one of the following options:

  • /html for the HTML GUI
  • /text for the text interface

Note that the URL for the text interface has changed from “” to “/text”.

The roles required to use the Host Manager application were changed from the singleadmin role to the following two roles. You will need to assign the role(s) required for the functionality you wish to access.

  • admin-gui – allows access to the HTML GUI and the status pages
  • admin-script – allows access to the text interface and the status pages

The HTML interface is protected against CSRF but the text interface is not. To maintain the CSRF protection:

  • users with the admin-gui role should not be granted the admin-script role.
  • if the text interface is accessed through a browser (e.g. for testing since this inteface is intended for tools not humans) then the browser must be closed afterwards to terminate the session.

解压版

E:\apache-tomcat-6.0.33\conf\tomcat-users.xml

  1. xml version='1.0' encoding='utf-8'?>   
  2. <tomcat-users>   
  3.   <role rolename="tomcat"/>   
  4.   <role rolename="role1"/>   
  5.   <role rolename="manager"/>   
  6.   
  7.   
  8.   <role rolename="admin"/>   
  9.   <user username="admin" password="admin" roles="admin,manager"/>   
  10.   
  11.   
  12.   <user username="tomcat" password="tomcat" roles="tomcat"/>   
  13.   <user username="role1" password="tomcat" roles="role1"/>   
  14.   <user username="both" password="tomcat" roles="tomcat,role1"/>   
  15. tomcat-users>   


和你的电脑里的tomcat-users.xml文件比较一下,多了8、9 那两行。
重新启动Tomcat ,在登录时使用 用户名admin 密码 admin 登录即可。


Tomcat配置admin,Manager

以前装Tomcat6.x,不知道它还有这个功能,尝试了好久才配置成功(俺比较笨)。

下载tomcat admin 的压缩包:

下载Apache Commons Modeler组件: 
下载地址:http://dev.xiaonei.com/apache-mirror/commons/modeler/binaries/commons-modeler-2.0.1.zip 
下载Apache Commons Logging组件:      
下载地址:
解压Apache Commons  Modeler,Logging组件,解压后将commons-modeler-XXX.jar、commons-logging-XXX.jar(只此两个Jar包)拷贝到Tomcat 6.0.x安装目录下的lib目录中
对$CATALINA_BASE/conf/tomcat-users.xml,进行修改,添加: 
   Tomcat6.x:

  


Tomcat7.x:




不想自己动手修改配置文件,请下载附件,找到对应的版本,放到conf文件夹下,覆盖掉以前的即可。

阅读(5746) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~