在点击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的更多相关文章

  1. 使用tomcat manager 管理和部署项目

    在部署tomcat项目的时候,除了把war文件直接拷贝到tomcat的webapp目录下,还有一种方法可以浏览器中管理和部署项目,那就是使用tomcat manager. 默认情况下,tomcat m ...

  2. Tomcat Manager 用户名和密码配置

    在Tomcat中,应用程序的部署很简单,只需将你的WAR放到Tomcat的webapp目录下,Tomcat会自动检测到这个文件,并将其解压.在浏览器中访问这个应用的Jsp时,通常第一次会很慢,因为To ...

  3. Tomcat Manager用户配置详解

      Tomcat Manager是Tomcat自带的.用于对Tomcat自身以及部署在Tomcat上的应用进行管理的web应用.Tomcat是Java领域使用最广泛的服务器之一,因此Tomcat Ma ...

  4. tomcat manager 的用户权限配置,及环境变量CATALINA_HOME的错位问题

    因为tomcat的manager是管理其他项目的发布.删除等操作的管理项目,所以需要为其设置登陆用户和密码,以及用户相应的访问权限,配置如下: tomcat-users.xml需要添加如下内容: &l ...

  5. 部署Tomcat服务时,解决Cannot invoke Tomcat Manager 异常

    最近,在使用Jenkins对工程一键部署的时候,出现调用Tomcat Manager 异常,对其解决方案特记于次. 异常信息 可能存在的异常:(1)Cannot invoke Tomcat manag ...

  6. 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: ...

  7. Cannot invoke Tomcat manager: socket write error

    一开始, 参照 http://www.cnblogs.com/yezhenhan/archive/2012/07/17/2594684.html mvn tomcat:redeploy 出现: Can ...

  8. Tomcat Manager用户名和密码

    在浏览器输入http://localhost:8080/,打开Tomcat自带的默认主页面,右侧有“administration”“documentation”等模块.选择“administratio ...

  9. 【Tomcat】使用tomcat manager 管理和部署项目,本地部署项目到服务器

    在部署tomcat项目的时候,除了把war文件直接拷贝到tomcat的webapp目录下,还有一种方法可以浏览器中管理和部署项目,那就是使用tomcat manager. 默认情况下,tomcat m ...

随机推荐

  1. HA 部署wordpress

    前提: 1.保证免密认证ssh 2.NTP时间是否同步: 3.保证防火墙,selinux关闭: 4.用户名互相能够解析:在hosts文件设置: 环境: 系统:centos6.8和centos7.2 I ...

  2. 小峰mybatis(3)mybatis分页和缓存

    一.mybatis分页-逻辑分页和物理分页: 逻辑分页: mybatis内置的分页是逻辑分页:数据库里有100条数据,要每页显示10条,mybatis先把100条数据取出来,放到内存里,从内存里取10 ...

  3. 利用ubuntu的alias命令来简化许多复杂难打的命令

    利用alias,可以将你要长期执行的命令,用一个你最喜欢的名字记下来, 用你最喜欢的编辑器打开.bashrc文件( 如$  vim ~/.bashrc) 在最后面输入: alias myssh='ss ...

  4. (转!)大话websocket

    邪正看眼鼻,真假看嘴唇,功名看气概,富贵看精神. ---曾国藩<冰鉴> 转自https://www.cnblogs.com/fuqiang88/p/5956363.html 原文http: ...

  5. Oracle jdk 历史版本官方下载地址及下载方法

    Oracle jdk 历史版本官方下载地址及下载方法 原文转载至:http://blog.csdn.net/chwshuang/article/details/54925950 平时要新装一个系统环境 ...

  6. Lua中的metatable详解

    转自:http://www.jb51.net/article/56690.htm Lua 中 metatable 是一个普通的 table,但其主要有以下几个功能: 1.定义算术操作符和关系操作符的行 ...

  7. skopt超参数优化实例

    import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import load_boston from skl ...

  8. Ubuntu16.04LTS中使用 apt-get install 出现错误 Could not get lock /var/lib/dpkg/lock 的解决方案

    背景 近期,在Ubuntu 16.04 LTS 的操作系统中,安装MySQL-python的时候出现缺少依赖包的情况: 当使用命令 # sudo apt-get install xxx 安装依赖包的时 ...

  9. 一个PHPer的规划

    前言:学PHP过时了吗?PHP开发人员如何快速成长?怎么进行职业规划?特别是近几年非常火热的人工智能,机器学习,区块链技术等等,这多少会带动一些人盲目跟风,迷茫等,下面是PHP大牛魏永强带来的一篇根据 ...

  10. 笔记本电脑安装centos 7(转)

    1. 下载 CentOS 镜像 下载地址 : https://wiki.centos.org/Download, 我下载的是1406 2. 使用 UltraISo 将镜像刻录到U盘 UltraISo  ...