(转)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 如果不注重安全性,只是测试用的话,对应部分可以简单地写成下面这个样子:
---------------------------------
<role rolename="admin"/>
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
---------------------------------
很多网页没说到第三个按钮针对的角色。不添加admin-gui和admin-script的话,第三个按钮就会出现访问被拒绝的问题(access denied ....)。
详细说明可以参考 Tomcat 的文档(http://tomcat.apache.org/migration.html#Manager_application):
|
Manager application |
|
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:
Note that the URL for the text interface has changed from "<ContextPath>" to "<ContextPath>/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.
The HTML interface is protected against CSRF but the text and JMX interfaces are not. To maintain the CSRF protection:
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. |
|
Host Manager application |
|
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:
Note that the URL for the text interface has changed from "<ContextPath>" to "<ContextPath>/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.
The HTML interface is protected against CSRF but the text interface is not. To maintain the CSRF protection:
|
(转)Tomcat 7 访问 Manager 和 Host Manager的更多相关文章
- Tomcat7/8访问Server Status、Manager App、Host Manager出现403 forbidden
在配置好Tomcat7/8后,我们往往需要访问Tomcat7/8的Manager以及Host Manager.就需要在tomcat-users.xml中配置用户角色来实现.在地址栏输入:localho ...
- Tomcat 访问 Manager App,Host Manager
1.启动tomcat,在浏览器输入:http://localhost:8080/ 2.配置tomcat-users.xml 文件 在主目录的cong文件夹下找到tomcat-users.xml 文件 ...
- tomcat如何登录Server Status、Manager App、Host Manager
启动tomcat后,访问127.0.0.1会进入如下页面 版权声明:本文为博主原创文章,未经博主允许不得转载. 原文地址:https://www.cnblogs.com/poterliu/p/9602 ...
- tomcat 登录主页成功 点击Manager App 401 等问题
1.将项目部署在tomcat的安装路径webapps下(如果报404,查下该应用是否在tomcat的webapps下部署着) 2.启动tomcat成功,http://127.0.0.1:8080成功, ...
- asterisk manager api 配置 (manager.conf)
http://blog.csdn.net/niino/article/details/5748805 要激活AMI,需要在/etc/asterisk/manager.conf中,[general]块下 ...
- Nginx服务器之Nginx与tomcat结合访问jsp
本文使用linux centos系统 本文概述: JSP是一种动态网页技术标准.使用的方式是在HTML文件中插入程序段和JSP标记,而形成JSP文件.使用JSP开发WEB应用可以跨平台开发.但jsp需 ...
- 配置Tomcat的访问日志格式化输出
博客搬家,本文新地址:http://www.zicheng.net/article/9 本文描述如何配置tomcat的访问日志,按我们的要求输出指定的日志格式. 且在Nginx+Tomcat的配置 ...
- Android SDK Manager和AVD Manager使用
Android SDK Manager和AVD Manager使用(win7_64bit下测试) 目录 1.概述 2.本文用到的工具 3.安卓开发基础工具包下载 4.Android SDK Manag ...
- 搭建Tomcat服务器访问本地资源
目标,搭建Tomcat服务器,使同网络段下其他电脑可以访问分享的文件 下载安装Tomcat 如下图,在官网http://Tomcat.apache.org/下载对应版本的Tomcat,解压安装即可 启 ...
随机推荐
- hdu 4640 Island and study-sister
bfs+状态压缩求出所有的状态,然后由于第一个节点需要特殊处理,可以右移一位剔除掉,也可以特判.然后采用集合的操作, #pragma comment(linker,"/STACK:10240 ...
- 辛星解读mysql的用户管理
可能做开发的多半不太关注这方面,可是要说到做运维.那就不能不关注了.由于我们都知道,root的权限太大了.不是随便能用的.我们平时最好用一些比較低的权限的用户.这样会让我们的安全性大大提高,也能防止我 ...
- C#语法糖: 扩展方法(常用)
今天继续分享C#4.0语法糖的扩展方法,这个方法也是我本人比较喜欢的方法.大家先想想比如我们以前写的原始类型不能满足现在的需求,而需要在该类型中添加新的方法来实现时大家会怎么做.我先说一下我没有学习到 ...
- Asp.Net HttpApplication 事件汇总
Global.asax 文件,有时候叫做 ASP.NET 应用程序文件,提供了一种在一个中心位置响应应用程序级或模块级事件的方法.你可以使用这个文件实现应用程序安全性以及其它一些任务.下面让我们详细看 ...
- PDO事务管理DEMO
try { $dsn = "mysql:host=127.0.0.1;port=3306;dbname=dab"; $pdo = new PDO($dsn, 'root', '') ...
- hdu 1215 七夕节
Problem Description 七夕节那天,月老来到数字王国,他在城门上贴了一张告示,并且和数字王国的人们说:"你们想知道你们的另一半是谁吗?那就按照告示上的方法去找吧!" ...
- 最小日志量的insert操作
--1.实验环境 SQL> conn scott/tiger Connected to Oracle Database 11g Enterprise Edition Release 11.2.0 ...
- EL表达式取整
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> 1. <fm ...
- 在mac中导入hadoop2.6.0源代码至eclipse
一.环境准备 1.安装jdk.maven等 2.下载hadoop源代码,并解压 3.将tools.jar复制到Classes中,具体原因见http://wiki.apache.org/hadoop/H ...
- 让footer在底部(测试它人方法)
要求:网页布局中,页脚在底部.内容不够一页时,在底部.内容超过一页时,出现卷动条,页脚也在被挤到底部 1.测试的这个文章介绍的办法 链接: http://www.cnblogs.com/cheny ...