管理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的Manager显示403 Access Denied的更多相关文章

  1. Tomcat 9.0 配置问题 403 Access Denied

    tomcat9.0 管理页面如:http://10.10.10.10:8080/manager/html出现如下错误: 403 Access Denied 1.需要配置: Tomcat/conf/to ...

  2. 登录时显示403 Access Denied

    用户名及密码设置如下: 在tomcat安装目录\conf\tomcat-users.xml中的<tomcat-users>标签内设置: <role rolename="ma ...

  3. JavaWeb——tomcat manager 403 Access Denied .You are not authorized to view this page.

    403 Access Denied You are not authorized to view this page. If you have already configured the Manag ...

  4. tomcat管理页面403 Access Denied的解决方法

    安装tomcat,配置好tomcat环境变量以后,访问manager app页面,出现403 Access Denied错误,解决的方法如下: 首先在conf/tomcat-users.xml文件里面 ...

  5. Tomcat8访问管理页面localhost出现:403 Access Denied

    问题: Access Denied You are not authorized to view this page. If you have already configured the Manag ...

  6. tomcat8 管理页面403 Access Denied的解决方法

      安装tomcat,配置好tomcat环境变量以后,访问manager app页面,出现403 Access Denied错误,解决的方法如下: 首先在conf/tomcat-users.xml文件 ...

  7. tomcat访问管理页面出现:403 Access Denied 解决方法

    点击红色框框出现以下403错误 打开context.xml文件 vim /usr/local/tomcat/webapps/manager/META-INF/context.xml <Conte ...

  8. Tomcat7以上403 Access Denied错误

    版本:Tomcat 9 问题:新安装的tomcat,访问tomcat的Server Status.Manager App.Host Manager三个页面均显示403,conf/tomcat-user ...

  9. 403 Access Denied :进入Tomcat的manager时拒绝访问

    解决办法: https://blog.csdn.net/Hello_World_QWP/article/details/79581174

随机推荐

  1. [oldboy-django][5python基础][高级特性]generator生成器

    # 生成器基础 - 定义 在循环的时候不断推算下一个元素的值,而不是一下子创建空间存储所有元素,这样节省空间. 并且在适当的条件结束循环,这种一边循环一边计算的机制,称为generator生成器 - ...

  2. poj3748 位运算 bitset

    位操作 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9064   Accepted: 3626 Description 假 ...

  3. linux开机关机自启动或自关闭服务的方式

    背景 由于迁移部门jira和confluence到linux,需要设置这两个服务在开机或关机时能够自动启动或关闭.这里我就拿配置confluence过程来记录. 方式1:chkconfig 特点:ch ...

  4. Dos中查看mysql数据时 中文乱码

    使用jsp页面查看数据时可以正确显示中文,但是dos窗口查看数据时中文显示乱码. 上网查了一下原因:之所以会显示乱码,就是因为MySQL客户端输出窗口显示中文时使用的字符编码不对造成的,可以使用如下的 ...

  5. Ubuntu 查看默认软件安装位置

    tags: Linux 方法 1:在命令行输入:dpkg -L 软件包名: 方法 2:在/var/cache/apt/archives找的你安装程序的包,然后用gdebi-gtk+软件包名可以查看具体 ...

  6. vue2搭建简易spa

    使用vue-cli来配置webpack,webpack是一个打包工具,使程序模块化 全局安装vue-cli: npm install -g vue-cli 安装好后,使用vue-cli脚手架配置web ...

  7. libc++abi.dylib`__cxa_throw: 使用[AVAudioPlayer play]会产生__cxa_throw异常

    libc++abi.dylib`__cxa_throw: 使用[AVAudioPlayer play]会产生__cxa_throw异常 开发中遇到一个奇怪的异常.我调用AVAudioPlayer pl ...

  8. T-SQL获取同类型数据不足补全的方法

    业务规则:如果有本地区的招聘会,显示本地区,如果没有本地区的招聘会,显示最近一场. 一条SQL搞定: [userId],[meetsName],[provinceId], [province],[ci ...

  9. 拖动层 拖动div 封装js 貌似不兼容FF,郁闷

    原文发布时间为:2009-12-02 -- 来源于本人的百度文章 [由搬家工具导入] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tran ...

  10. linux内核之系统调用nanosleep与pause()

    nanosleep()使得进程进入睡眠状态,指定时候后唤醒进程,sleep()基于其实现 asmlinkage long sys_nanosleep(struct timespec *rqtp, st ...