(转)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,解压安装即可 启 ...
随机推荐
- JSP简单练习-数组应用实例
<%@ page contentType="text/html; charset=gb2312" %> <html> <body> <% ...
- 【leetcode】Merge k Sorted Lists(按大小顺序连接k个链表)
题目:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity ...
- WP系统推广难的原因之中的一个之我见
个人也觉得如今的Android市场几家独大,竞争太激烈.利润空间挤压太严重,有实力的厂家不如尝试剑走偏锋,在其它大佬都还没跟进的时候,把市场投向WP.先入为主,不失为良策! 话说Microsoft不开 ...
- [Angular 2] Event in deep
This lesson talks about the benefits of using the parens-based (click) syntax so that Angular 2 can ...
- IP转发和子网路由
IP地址的分类 在TCP/IP协议中,协议栈分为4层.从上到下依次是应用层.运输层.网络层.网络接口层. IP协议就工作在网络层.IP协议将纷繁复杂的物理层协议屏蔽掉,对上层提供统一的描述和管理服务. ...
- js_day13
- this函数的理解
Javascript的this用法 this是Javascript语言的一个关键字. 它代表函数运行时,自动生成的一个内部对象,只能在函数内部使用.比如, function test(){ this. ...
- SuperSocket学习笔记(二)
上一篇博客SuperSocket学习笔记(一)说明了怎么快速搭建一个服务器端,这篇文章我想深挖一下SuperSocket 1. 每一个客户端连接到服务器端时,服务器端会将客户端的信息保存到一个Sess ...
- myeclipse添加svn
一直在用MyEclipse,每次重装或者换开发环境时都需要安装svn插件,每次都是在网上找,感觉没有说的太明白的,还是自己写个以备将来查看. 安装svn插件有很多种方式,在线的.离线的.解压的(又分为 ...
- CSS选择器4是下一代CSS选择器规范
那么,这一版本的新东西有哪些呢? 选择器配置文件 CSS选择器分为两类:快速选择器和完整选择器.快速选择器适用于动态CSS引擎.完整选择器适用于速度不占关键因素的情况,例如document.query ...