tomcat manager
在点击tomcat manager的时候提示以下内容:
You are not authorized to view this page.
By default the Host Manager is only accessible from a browser running on the same machine as Tomcat. If you wish to modify this restriction, you'll need to edit the Host Manager'scontext.xml file.
If you have already configured the Host Manager application to allow access and you have used your browsers back button, used a saved book-mark or similar then you may have triggered the cross-site request forgery (CSRF) protection that has been enabled for the HTML interface of the Host Manager application. You will need to reset this protection by returning to themain Host Manager page. Once you return to this page, you will be able to continue using the Host Manager appliction's HTML interface normally. If you continue to see this access denied message, check that you have the necessary permissions to access this application.
If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.
For example, to add the admin-gui role to a user named tomcat with a password ofs3cret, add the following to the config file listed above.
<role rolename="admin-gui"/>
<user username="tomcat" password="s3cret" roles="admin-gui"/>
Note that for Tomcat 7 onwards, 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
- admin-script - allows access to the text interface
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 interface is intended for tools not humans) then the browser must be closed afterwards to terminate the session.
这是因为两个地方可能有问题
第一个地方:
$TOMCAT_HOME/webapps/manager/META-INF/context.xml文件中
<Context antiResourceLocking="false" privileged="true" >
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
</Context>
配置有问题,因为只允许本机访问所以其他人无法访问,只需加入本机ip即可
<Context antiResourceLocking="false" privileged="true" >
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1|10.0.1.143" />
第二个地方:
$TOMCAT_HOME/conf/tomcat-users.xml
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<role rolename="tomcat-gui"/>
<user username="tomcat" password="GFJuwldhzjEYE" roles="manager-script,admin-script,admin-gui,tomcat,manager-gui"/>
</tomcat-users>
tomcat manager的更多相关文章
- 使用tomcat manager 管理和部署项目
在部署tomcat项目的时候,除了把war文件直接拷贝到tomcat的webapp目录下,还有一种方法可以浏览器中管理和部署项目,那就是使用tomcat manager. 默认情况下,tomcat m ...
- Tomcat Manager 用户名和密码配置
在Tomcat中,应用程序的部署很简单,只需将你的WAR放到Tomcat的webapp目录下,Tomcat会自动检测到这个文件,并将其解压.在浏览器中访问这个应用的Jsp时,通常第一次会很慢,因为To ...
- Tomcat Manager用户配置详解
Tomcat Manager是Tomcat自带的.用于对Tomcat自身以及部署在Tomcat上的应用进行管理的web应用.Tomcat是Java领域使用最广泛的服务器之一,因此Tomcat Ma ...
- tomcat manager 的用户权限配置,及环境变量CATALINA_HOME的错位问题
因为tomcat的manager是管理其他项目的发布.删除等操作的管理项目,所以需要为其设置登陆用户和密码,以及用户相应的访问权限,配置如下: tomcat-users.xml需要添加如下内容: &l ...
- 部署Tomcat服务时,解决Cannot invoke Tomcat Manager 异常
最近,在使用Jenkins对工程一键部署的时候,出现调用Tomcat Manager 异常,对其解决方案特记于次. 异常信息 可能存在的异常:(1)Cannot invoke Tomcat manag ...
- Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project Resource: Cannot invoke Tomcat manager: Connection refused: connect -> [Help 1]
1.问题描述 在 DOS 下执行 tomcat7-maven-plugin 插件部署,启动 Apache Tomcat 服务报错如下: D:\2018\code\XXX>mvn tomcat7: ...
- Cannot invoke Tomcat manager: socket write error
一开始, 参照 http://www.cnblogs.com/yezhenhan/archive/2012/07/17/2594684.html mvn tomcat:redeploy 出现: Can ...
- Tomcat Manager用户名和密码
在浏览器输入http://localhost:8080/,打开Tomcat自带的默认主页面,右侧有“administration”“documentation”等模块.选择“administratio ...
- 【Tomcat】使用tomcat manager 管理和部署项目,本地部署项目到服务器
在部署tomcat项目的时候,除了把war文件直接拷贝到tomcat的webapp目录下,还有一种方法可以浏览器中管理和部署项目,那就是使用tomcat manager. 默认情况下,tomcat m ...
随机推荐
- 安全测试chicklist
- 查看selenium api的方法
首先打开命令行,在doc窗口输入: python -m pydoc -p 4567简单解释一下: python -m pydoc表示打开pydoc模块,pydoc是查看python文档的首选工具:-p ...
- 配置Samba(CIFS)
试验环境:一台CentOS 7.0的虚拟机,一台Windows 的普通台式机. 注意:网络一定能够ping通 关闭SeLinux # setenforce 0 # getenforce 关闭防火墙 # ...
- Nginx Tengine ngx_http_upstream_check_module 健康功能检测使用
该模块可以为Tengine提供主动式后端服务器健康检查的功能. 该模块在Tengine-1.4.0版本以前没有默认开启,它可以在配置编译选项的时候开启:./configure --with-http_ ...
- RouterOS 设定NAT loopback (Hairpin NAT)回流
In the below network topology a web server behind a router is on private IP address space, and the r ...
- CORS跨域的概念与TP5的解决方案
namespace app\api\behavior; use think\Response; class CORS{ public function appInit(&$params) { ...
- (转)linux查找技巧: find grep xargs
在当前目录下所有.cpp文件中查找efg函数 find . -name "*.cpp" | xargs grep 'efg' xargs展开find获得的结果,使其作为grep的参 ...
- mysql更新(八) 可视化工具Navicat的使用 索引
17-索引 一.索引的介绍 数据库中专门用于帮助用户快速查找数据的一种数据结构.类似于字典中的目录,查找字典内容时可以根据目录查找到数据的存放位置吗,然后直接获取. 二 .索引的作用 约束和加速查 ...
- url的命名与反向解析
url命名和反向解析 1. 命名 # url(r'^press_list/$', views.press_list,name='press_list'), url(r'^pre/$', ...
- Data Provider 中没有.net framework Data provider for Mysql 的解决方法
近来做的一个项目中,数据库用的是 MySql, 而在项目使用 Entity Data Model 来做数据服务层,可是在项目中添加 Data Entty Model 时,一般我们都会选择从数据库中直接 ...