随笔- 458  文章- 0  评论- 38 

Tomcat的Manager显示403 Access Denied

 

管理tomcat的时候遇到了以下问题:

  1.刚开始需要用户名密码,不知道用户名和密码是什么,但是输入什么都不正确。

  解决办法:

  自己在tomcat-users.xml中按格式添加用户 conf文件夹里面

  默认是注释掉了的,这主要是考虑到服务器的安全,如果是本地测试,去掉以下这段注释,然后重启动服务器,再输入

   <role rolename="tomcat"/>

    <role rolename="role1"/>

    <user username="tomcat" password="tomcat" roles="tomcat"/>

    <user username="both" password="tomcat" roles="tomcat,role1"/>

    <user username="role1" password="tomcat" roles="role1"/>

  用户和密码都一目了然了。

  2.进入manager界面之后,显示的是403 Access Denied。

  解决办法:

  在conf/tomcat-users.xml文件中看到这么一段话:

  NOTE:  By default, no user is included in the "manager-gui" role required

    to operate the "/manager/html" web application.  If you wish to use this app,

    you must define such a user - the username and password are arbitrary.

  也就是说,为了考虑安全,tomcat默认还是没有manager-gui的管理权限的,如果想要使用manager

  的话,需要自行加入管理权限(角色)。

  需要加一个这样的权限(角色)

  <role rolename="manager-gui"/>

  然后再加到需要的用户名中去

  <user username="tomcat" password="tomcat" roles="tomcat,manager-gui"/>

  这样OK了。

<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<tomcat-users>
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary.
-->
<!--
NOTE: The sample user and role entries below are wrapped in a comment
and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
--> <!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
-->
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="ming" password="064417" roles="manager-gui,admin-gui"/> </tomcat-users>

tomcat管理员配置的更多相关文章

  1. Tomcat 常用配置

    1.Tomcat 管理员设置 想要进入Tomcat管理界面: 打开Tomcat 目录 :进入 Conf目录,找到tomcat-users.xml文件,打开 修改 tomcat-users 节, 2.T ...

  2. 设置Tomcat管理员用户名和密码

    http://dove19900520.iteye.com/blog/1774980 今天tomcat出点问题,然后我就想进入tomcat manager看看,结果怎么输入密码都不行,后来网上查了查才 ...

  3. 【CAS单点登录视频教程】 第04集 -- tomcat下配置https环境

    目录 ----------------------------------------- [CAS单点登录视频教程] 第06集[完] -- Cas认证 学习 票据认证FormsAuthenticati ...

  4. Tomcat应用配置

    为Tomcat添加管理员 为了更好的管理tomcat服务器,我们通常会给tomcat添加用户管理员,这样就可以登录进入查看发布的项目.以下是实际操作步骤: 在Tomcat的配置目录下找到tomcat- ...

  5. 关于tomcat文件下载配置

    前言 tomcat文件下载 关闭tomcat目录列表浏览功能 Tomcat 不能下载带中文文件名的附件的方法 在Java Web项目中文件下载是一个很常见的功能,最近在做项目中发现可以通过tomcat ...

  6. 在tomcat中配置jdk的不同版本

    在tomcat中配置jdk的不同版本---------------------------------------------------------------------------------- ...

  7. Tomcat安装配置

    Tomcat安装配置 很久没有通过博客对学习所得进行记录了. 现在将使用Tomcat的一些经验和心得写到这里,作为记录和备忘.如果有朋友看到,也请不吝赐教. 1.首先是Tomcat的获取和安装. 获取 ...

  8. 腾讯云服务器centos 6.5(jdk+tomcat+vsftp)、腾讯mysql数据库 及 tomcat自启动 配置教程

    1.腾讯云数据库配置 1.考虑到安全性问题,,平常不使用root用户登录,新增一个用户名neil,用来管理项目的数据库 a.首先登录root创建db_AA数据库 b.在root用户下,创建neil用户 ...

  9. [转载]JavaEE学习篇之——网络传输数据中的密码学知识以及Tomcat中配置数字证书EE

    原文链接:http://blog.csdn.net/jiangwei0910410003/article/details/21716557 今天是学习JavaWeb的第二天,我们来了解什么呢?就了解一 ...

随机推荐

  1. Implement Stack using Queues

    Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. po ...

  2. 使用Uploadify实现上传图片生成缩略图例子,实时显示进度条

    不了解Uploadify的,先看看前一篇详细说明 http://www.cnblogs.com/XuebinDing/archive/2012/04/26/2470995.html Uploadify ...

  3. 联想Y50p预装win8系统改为win7

    &1 修改OS Optimized Defaults 开机,按[F2]进入BIOS设置,按右方向键选择到EXIT上面,按下方向键选择OS Optimized Defaults,回车,将Win8 ...

  4. .NET面试题解析(07)-多线程编程与线程同步 (转)

    http://www.cnblogs.com/anding/p/5301754.html 系列文章目录地址: .NET面试题解析(00)-开篇来谈谈面试 & 系列文章索引 关于线程的知识点其实 ...

  5. [Android] emualtor-5554 offline的解决方法

    现象:用adb devices命令总发现emualtor-5554 offline,在.android目录下面并没有发现这个设备,没法删除.原因:有程序占用5555端口,导致adb认为5554不能作为 ...

  6. 《Linux内核设计与实现》Chapter 3 读书笔记

    <Linux内核设计与实现>Chapter 3 读书笔记 进程管理是所有操作系统的心脏所在. 一.进程 1.进程就是处于执行期的程序以及它所包含的资源的总称. 2.线程是在进程中活动的对象 ...

  7. 学习Java第一卷--态度的转变

    你对自己的未来有什么规划?做了哪些准备? 认真学习,修身养性,做自己感兴趣的,在大学一定学好Java,将自己的专业学好学精. 我觉得未来十几年或几十年是自己无法完全控制的,只有自己朝着自己心中的目标努 ...

  8. EF实体框架之CodeFirst三

    前两篇博客学习了数据库映射和表映射,今天学习下数据库初始化.种子数据.EF执行sql以及执行存储过程这几个知识. 一.数据库初始化策略 数据库初始化有4种策略 策略一:数据库不存在时重新创建数据库 D ...

  9. 用Wireshark抓包分析超过70秒的请求

    超过70秒的请求是通过分析IIS日志发现的: 10.159.63.104是SLB的内网IP. 通过Wireshark抓包分析请求是9:22:21收到的(tcp.stream eq 23080): 09 ...

  10. [工具类]将时间转换为unix时间戳格式

    写在前面 由于在数据库中存的时间有时间戳格式的数据,在解析以及保存的时候,就需要考虑到数据格式的兼容性问题.看到数据库中的时间字段基本上都是以时间戳格式存储的,没办法,只能将时间进行转换了,考虑到其他 ...