在Tomcat上发布war之前需要配置一个管理用户以进入上传页面,而配置就是通过修改/usr/local/tomcat6/conf/tomcat-users.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

      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"/>
  <role rolename="manager"/>
  <user username="president" password="123" roles="manager"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>

上面的

<role rolename="manager"/>
  <user username="president" password="123" roles="manager"/>

这两句是新加入的,这两句就把管理用户配置上了。其它部分无需修改。

另外一点需要注意的是,有时

<role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager"/>
  <user username="president" password="123" roles="manager"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>

这一整段都被上面的<!-- 和下面的 -->包围着,致使中间的内容被屏蔽而不起作用,这在VI编辑器中不容易发现,需要人为多注意一下。

修改好tomcat-users.xml文件后,重启tomcat就能进去上传war的页面了。

2016年3月1日20:27:44

配置Tomcat6的管理用户的更多相关文章

  1. JavaWeb学习之tomcat安装与运行、tomcat的目录结构、配置tomcat的管理用户、web项目目录、虚拟目录、虚拟主机(1)

    1.tomcat安装与运行双击tomcat目录下的bin/startup.bat,启动之后,输入http://localhost:8080,出现安装成功的提示,表示安装tomcat成功 2.tomca ...

  2. tomcat6~7~8用户设置及一个独立服务器上跑多个tomcat配置JVM设置优化亲测

    tomcat6管理用户 在tomcat `安装根目录`/conf/tomcat-users.xml

  3. window服务器上mongodb的安装与如何将mongodb设置为服务,为mongodb设置管理用户,mongodb连接字符串配置

    最近公司有一个项目模块让用nosql-mongodb替换了,故,对mongodb做了一点研究,然后分享一下! 1.首先说一下安装时的坑 下载mongodb,如果你从官网下载,将会是一件很慢的事情,在公 ...

  4. 【Java EE 学习 30】【闪回】【导入导出】【管理用户安全】【分布式数据库】【数据字典】【方案】

    一.闪回 1.可能的误操作 (1)错误的删除了记录 (2)错误的删除了表 (3)查询历史记录 (4)撤销已经提交了的事务. 2.对应着以上四种类型的误操作,有四种闪回类型 (1)闪回表:将表回退到过去 ...

  5. 事务管理(下) 配置spring事务管理的几种方式(声明式事务)

    配置spring事务管理的几种方式(声明式事务) 概要: Spring对编程式事务的支持与EJB有很大的区别.不像EJB和Java事务API(Java Transaction API, JTA)耦合在 ...

  6. JMeter学习-014-JMeter 配置元件实例之 - 用户定义的变量 参数化配置

    前文讲述了通过 CSV Data Set Config 实现参数化配置(详情敬请参阅:JMeter学习-010-JMeter 配置元件实例之 - CSV Data Set Config 参数化配置), ...

  7. 在Web.Config文件中使用configSource,避免动态修改web.config导致asp.net重启(另添加一个Config文件用于管理用户数据)

    原文:在Web.Config文件中使用configSource,避免动态修改web.config导致asp.net重启(另添加一个Config文件用于管理用户数据) 我们都知道,在asp.net中修改 ...

  8. springBoot+springSecurity 数据库动态管理用户、角色、权限

    使用spring Security3的四种方法概述 那么在Spring Security3的使用中,有4种方法: 一种是全部利用配置文件,将用户.权限.资源(url)硬编码在xml文件中,已经实现过, ...

  9. 使用成员资格管理用户Membership

    ASP.NET成员资格使您可以验证和管理Web应用程序的用户信息.它提供验证用户凭据,创建和修改成员资格用户以及管理用户设置(如密码和电子邮件地址)的功能. ASP.NET成员资格主要用于ASP.NE ...

随机推荐

  1. WebConfig配置文件详解(转载自逆心的博客)

    <?xml version="1.0"?> <!--注意: 除了手动编辑此文件以外,您还可以使用 Web 管理工具来配置应用程序的设置.可以使用 Visual S ...

  2. 在openGL中绘制图形

    点的绘制.: glVertex*():星号表示函数要有后缀 该函数 需要放在glBegin函数和glEnd函数之间,glBegin函数的向量指定绘制图元的类型,而glEnd函数没有参数,例如: glB ...

  3. javascript获取随机rgb颜色和十六进制颜色的方法

    <div id="console">在线交易平台的成功秘诀:从 Ebay 到 Yelp 到 Uber</div> <script type=" ...

  4. 在Excel中实现查询功能

    $sn = Read-Host -Prompt "请输入员工号|序列号|资产号" $xl = New-Object -ComObject "Excel.Applicati ...

  5. AngularJS 初识笔记

    test.html: <!DOCTYPE html> <html lang="en" ng-app> <head> <meta chars ...

  6. mysql 导入导出.sql文件

    备份数据库(包含全部表和全部存储过程):C:\Documents and Settings\Administrator>mysqldump -h localhost -u root -p -R ...

  7. extjs文件上传

    EXT学习教程:http://www.cnblogs.com/iamlilinfeng/category/385121.html Ext文件上传: 例子用到的jar:   1.upload.js /* ...

  8. [转]理解OAuth 2.0

    作者: 阮一峰 OAuth是一个关于授权(authorization)的开放网络标准,在全世界得到广泛应用,目前的版本是2.0版. 本文对OAuth 2.0的设计思路和运行流程,做一个简明通俗的解释, ...

  9. MySQL binlog-do-db选项是危险的

    很多人通过 binlog-do-db, binlog-ignore-db, replicate-do-db 和   replicate-ignore-db 来过滤复制(某些数据库), 尽管有些使用, ...

  10. file_get_contents无法获取数据的一种情况

    下面这段php代码突然不好使了,返回的 $html 为空,百思不得解.网上说法好多,但都是一家之言,解决不了我的问题.(我的解决方法也是一家之言,只能解决file_get_contents获取不到数据 ...