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的Manager显示403 Access Denied的更多相关文章
- Tomcat 9.0 配置问题 403 Access Denied
tomcat9.0 管理页面如:http://10.10.10.10:8080/manager/html出现如下错误: 403 Access Denied 1.需要配置: Tomcat/conf/to ...
- 登录时显示403 Access Denied
用户名及密码设置如下: 在tomcat安装目录\conf\tomcat-users.xml中的<tomcat-users>标签内设置: <role rolename="ma ...
- 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 ...
- tomcat管理页面403 Access Denied的解决方法
安装tomcat,配置好tomcat环境变量以后,访问manager app页面,出现403 Access Denied错误,解决的方法如下: 首先在conf/tomcat-users.xml文件里面 ...
- Tomcat8访问管理页面localhost出现:403 Access Denied
问题: Access Denied You are not authorized to view this page. If you have already configured the Manag ...
- tomcat8 管理页面403 Access Denied的解决方法
安装tomcat,配置好tomcat环境变量以后,访问manager app页面,出现403 Access Denied错误,解决的方法如下: 首先在conf/tomcat-users.xml文件 ...
- tomcat访问管理页面出现:403 Access Denied 解决方法
点击红色框框出现以下403错误 打开context.xml文件 vim /usr/local/tomcat/webapps/manager/META-INF/context.xml <Conte ...
- Tomcat7以上403 Access Denied错误
版本:Tomcat 9 问题:新安装的tomcat,访问tomcat的Server Status.Manager App.Host Manager三个页面均显示403,conf/tomcat-user ...
- 403 Access Denied :进入Tomcat的manager时拒绝访问
解决办法: https://blog.csdn.net/Hello_World_QWP/article/details/79581174
随机推荐
- ssh-add Could not open a connection to your authentication agent.
ssh-add 报错Could not open a connection to your authentication agent. 需要执行以下代码 eval `ssh-agent -s` ssh ...
- spring boot redis代码与配置
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Co ...
- Redhat/CentOS安装vsftp软件
1.更新yum源 首先需要更新系统的yum源,便捷工具下载地址:http://help.aliyun.com/manual?spm=0.0.0.0.zJ3dBU&helpId=1692 2.安 ...
- 【bzoj4999】This Problem Is Too Simple! 树链剖分+动态开点线段树
题目描述 给您一颗树,每个节点有个初始值. 现在支持以下两种操作: 1. C i x(0<=x<2^31) 表示将i节点的值改为x. 2. Q i j x(0<=x<2^31) ...
- 个人环境搭建——搭建jenkins持续构建集成环境
---恢复内容开始--- 搭建jenkins持续构建集成环境 要搭建jenkins持续构建集成环境,首先要安装tomcat和JDK: 第一部分,基本说明: 敏捷(Agile) 在软件工程领域 ...
- react 基础语法复习1- 搭建开发环境
之前有看过阮一峰老师的react教程跟着做了一遍,学习了一下.好久没看,有点忘记了,这次跟着脚手架工具系统的复习一遍.顺便学习学习 react-router 和 redux 首先,脚手架工具我使用的是 ...
- HTML 删除和添加字
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- pat 团体天梯 L3-003. 社交集群
L3-003. 社交集群 时间限制 1000 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 在社交网络平台注册时,用户通常会输入自己的兴趣爱好, ...
- pat 团体天梯赛 L3-010. 是否完全二叉搜索树
L3-010. 是否完全二叉搜索树 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 将一系列给定数字顺序插入一个初始为空的二叉搜 ...
- NOI2001食物链
描述 动物王国中有三类动物 A,B,C,这三类动物的食物链构成了有趣的环形.A吃B,B吃C,C吃A. 现有N个动物,以1-N编号.每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种. 有人 ...