tomcat管理员配置
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了。
![](https://common.cnblogs.com/images/copycode.gif)
<?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>
![](https://common.cnblogs.com/images/copycode.gif)
tomcat管理员配置的更多相关文章
- Tomcat 常用配置
1.Tomcat 管理员设置 想要进入Tomcat管理界面: 打开Tomcat 目录 :进入 Conf目录,找到tomcat-users.xml文件,打开 修改 tomcat-users 节, 2.T ...
- 设置Tomcat管理员用户名和密码
http://dove19900520.iteye.com/blog/1774980 今天tomcat出点问题,然后我就想进入tomcat manager看看,结果怎么输入密码都不行,后来网上查了查才 ...
- 【CAS单点登录视频教程】 第04集 -- tomcat下配置https环境
目录 ----------------------------------------- [CAS单点登录视频教程] 第06集[完] -- Cas认证 学习 票据认证FormsAuthenticati ...
- Tomcat应用配置
为Tomcat添加管理员 为了更好的管理tomcat服务器,我们通常会给tomcat添加用户管理员,这样就可以登录进入查看发布的项目.以下是实际操作步骤: 在Tomcat的配置目录下找到tomcat- ...
- 关于tomcat文件下载配置
前言 tomcat文件下载 关闭tomcat目录列表浏览功能 Tomcat 不能下载带中文文件名的附件的方法 在Java Web项目中文件下载是一个很常见的功能,最近在做项目中发现可以通过tomcat ...
- 在tomcat中配置jdk的不同版本
在tomcat中配置jdk的不同版本---------------------------------------------------------------------------------- ...
- Tomcat安装配置
Tomcat安装配置 很久没有通过博客对学习所得进行记录了. 现在将使用Tomcat的一些经验和心得写到这里,作为记录和备忘.如果有朋友看到,也请不吝赐教. 1.首先是Tomcat的获取和安装. 获取 ...
- 腾讯云服务器centos 6.5(jdk+tomcat+vsftp)、腾讯mysql数据库 及 tomcat自启动 配置教程
1.腾讯云数据库配置 1.考虑到安全性问题,,平常不使用root用户登录,新增一个用户名neil,用来管理项目的数据库 a.首先登录root创建db_AA数据库 b.在root用户下,创建neil用户 ...
- [转载]JavaEE学习篇之——网络传输数据中的密码学知识以及Tomcat中配置数字证书EE
原文链接:http://blog.csdn.net/jiangwei0910410003/article/details/21716557 今天是学习JavaWeb的第二天,我们来了解什么呢?就了解一 ...
随机推荐
- win7(X64)系统下cuda7.5和VS2013的配置
&1 安装 cuda7.5文件:链接:http://pan.baidu.com/s/1bU2zIQ 密码:nvyw &2 环境变量 注意:CUDA_PATH是安装好cuda7.5之后会 ...
- jquery-lazyload延迟加载图片 及 加载顺序 bug 修复
jquery-lazyload延迟加载图片 代码修改片段 function update() { var counter = 0; /**fix by weiyj start***/ elemen ...
- js学习第二篇简单语法
字符串(String)字面量 可以使用单引号或双引号 数组(Array)字面量 定义一个数组: [40, 100, 1, 5, 25, 10] 对象(Object)字面量 定义一个对象: {first ...
- c# 模拟get和post
private string HttpPost(string Url, string postDataStr) { HttpWebRequest request ...
- STM32的bulk双缓冲传输速度的讨论,硬件的坑永远填不完
详情:http://bbs.21ic.com/forum.php?mod=viewthread&tid=109584 USB 1.0的最高12Mbps. USB 2.0的高速模式480Mb ...
- C#6.0特性(快来围观)
说明一下,很多博友一进来就认为仅仅是语法糖,C#语法的更新,代表着它的进步,语法糖是为了让我们更好的实现语句和功能,增加了易读性和易用性.而且它的每次进步,也会给我们带来新的支持和改进.比如C#(4. ...
- Docker私有仓库Registry的搭建验证
1. 关于Registry 官方的Docker hub是一个用于管理公共镜像的好地方,我们可以在上面找到我们想要的镜像,也可以把我们自己的镜像推送上去.但是,有时候,我们的使用场景需要我们拥有一个私有 ...
- Bootstrap系列 -- 21. 表单提示信息
平常在制作表单验证时,要提供不同的提示信息.在Bootstrap框架中也提供了这样的效果.使用了一个"help-block"样式,将提示信息以块状显示,并且显示在控件底部. < ...
- http请求过程简要
一次http请求主要分为3个大步. 建立tcp连接. 这里就发生了经典的tcp三次握手.做个类比解释下,tcp好比http的秘书,和厂家(服务器端)做买卖.老板(http)叫秘书(tcp)去联系一下, ...
- xcode更新,想想也是醉了
每次更新,都要整个文件全部更新,这下载速度,想想也是醉了,苹果你就不能搞了更新包吗!!