Tomcat 配置2 tomcat-users.xml
Tomcat的配置
Tomcat的主要配置文件有3个,分别是:
Tomcat-users.xml、
web.xml
server.xml。
配置Tomcat-users.xml
该文件包含了所有Tomcat服务器的注册用户,其中有role(角色)、user(用户)两种信息。
下面列举出这个XML文件的全部内容。
<?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
以上是apache版本许可协议(感谢apache提供开源软件)
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="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="admin" password="network" roles="admin,manager,role1,tomcat,admin-gui,admin-script,manager-gui,manager-script,manager-jmx,manager-status" />
</tomcat-users>
tomcat配置tomcat-users.xml
关于tomcat的用户登录、管理配置

tomcat的管理员配置文件位置在~/conf/tomcat-users.xml
一、tomcat6管理员配置

在tomcat-users.xml添加如下代码:
<role rolename="admin"/>
<role rolename="manager"/>
<user username="admin" password="admin" roles="admin,manager"/>
即可使用用户名:admin 密码:admin进行登录管理
二、tomcat7和tomcat8的管理员用户配置
tomcat7中添加了manager=gui和admin-gui角色
所以配置文件配置为:
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="admin"/>
<role rolename="admin-gui"/>
<user username="admin" password="admin" roles="admin-gui,admin,manager-gui,manager"/>
tomcat首页上的Server Status、Manager App、Host Manager即可使用admin进行登录管理
Tomcat 配置2 tomcat-users.xml的更多相关文章
- Tomcat的SSL证书配置以及Tomcat+Nginx实现SSL配置
把jks上传到java容器在的服务器上,路径只要不是webapps下就可以,然后到conf目录下server.xml里配置 <Connector port=" protocol=&qu ...
- 图文解说:Nginx+tomcat配置集群负载均衡
图文解说:Nginx+tomcat配置集群负载均衡 博客分类: appserver nginxTomcatUbuntuLinux网络应用 作者:niumd Blog:http://ari.iteye ...
- Nginx+tomcat配置集群负载均衡
开发的应用采用F5负载均衡交换机,F5将请求转发给5台hp unix服务器,每台服务器有多个webserver实例,对外提供web服务和socket等接口服务.之初,曾有个小小的疑问为何不采用开源的a ...
- apache+tomcat配置负载均衡,实现http与websocket接口分压
一.应用场景 在生产环境中,应用服务器(此文以tomcat为例)不免面临高访问量的压力,相比而言web服务器(此文以apache为例)能够承担更大的并发量.Apache本身带有一些模块,可以完成对应用 ...
- Tomcat下conf下server.xml的文件配置信息
Tomcat下conf下server.xml的文件配置信息,基本上不用做任何修改就可以使用,修改的地方就是host区域的一些配置,此文件设置端口为80. 注意:Tomcat配置文件中(即server. ...
- Tomcat配置(二):tomcat配置文件server.xml详解和部署简介
*/ .hljs { display: block; overflow-x: auto; padding: 0.5em; color: #333; background: #f8f8f8; } .hl ...
- Tomcat配置 —— server.xml
Tomcat的核心组件是servlet容器. Tomcat各个组件之间的嵌套关系 server.xml配置如下: <Server port="8005" shutdown=& ...
- 关于web.xml的welcome-file-list 配置与tomcat的关系:
关于web.xml的welcome-file-list 配置与tomcat的关系: 2018年04月18日 10:17:13 守望dfdfdf 阅读数:377 标签: welcome-file-lis ...
- Tomcat 配置详解/优化方案
转自:http://blog.csdn.net/cicada688/article/details/14451541 Service.xml Server.xml配置文件用于对整个容器进行相关的配置 ...
随机推荐
- 七牛云 融合CDN测试域名 -> 融合CDN加速域名
七牛云 融合CDN测试域名 -> 融合CDN加速域名 本篇主要讲解 如何将七牛云融合CDN测试域名 切换到自定义的加速域名上去,为什么会写这篇是因为我收到了一封 [七牛云]测试域名回收通知的邮件 ...
- 轻松弄懂var、let、const之间的区别
ECMAScript 6(简称ES6)是JavaScript语言的下一代标准,于2015年6月正式发布,也称ECMAScript 2015. ES6的好处 ES6的出现为我们前端带来了很多方便之处,以 ...
- Akka Java 文档 -- 容错
[转自: http://blog.csdn.net/zjw10wei321/article/details/46911825] 容错 实际中的故障处理 容错案例图解 容错案例所有源码 创建新的监管策略 ...
- 5.Switch多选择结构
Switch语句: 多选择结构还有一个实现方式就是 switch case 语句 switch case 语句判断一个变量与一系列值中的某个值是否相等,每个值称为一个分支. switch语句中的变量类 ...
- Nginx配置及负载均衡
转载:http://www.cnblogs.com/jingmoxukong/p/5945200.html nginx简易教程 目录 Nginx 概述 安装与使用 nginx 配置实战 参 ...
- tomcat+jenkins搭建持续化集成环境
一.下载安装Tomcat 1.进入官网http://tomcat.apache.org/ 2.解压缩文件到指定目录 3.设置环境变量 a.新建CATALINA_HOME b.在path中设置 %CAT ...
- CUDA学习(一)之使用GPU输出HelloWorld
最近在学习CUDA,编程入门第一步便是“HelloWorld”,主要代码如下: #include "cuda_runtime.h" #include "device_la ...
- 暑假第三周总结(学习HDFS操作方法)
本周由于自己出去玩,以及家里的各种事也没好好看书,就对HDFS的一些常用的shell命令进行了学习与应用,观看了林子雨老师关于HDFS的视频,对HDFS的一些存储的原理.规则进行了一定的了解.对uba ...
- javaIO笔记
原创 File类 实例化 new File(path); File.separator 分隔符 创建文件的常规做法
- TortoiseSVN的安装及其简单使用
VisualSVN-Server的安装以及简单使用 TortoiseSVN的安装及其简单使用 VisualSVN的安装及冲突的处理 安装完VisualSVN-Server后,Test仓储里边什么都没有 ...