我们可以通过图形用户界面来管理tomcat,启动tomcat,在地址栏中输入:

Java代码

  1. http://localhost:8080

就可以看见tomcat的欢迎页面,点击左边的tomcat manager 就会出现一个对话框,需要输入用户名和密码,当忘记最开始安装tomcat时的用户名和密码时,我们可以通过以下方杰来解决: 
修改tomcat-users.xml文件,这个文件在tomcat的安装目录下的conf目录下,打开这个文件,我们可以看到如下信息:

Java代码

  1. <tomcat-users>
  2. <!--
  3. NOTE: By default, no user is included in the "manager-gui" role required
  4. to operate the "/manager/html" web application. If you wish to use this app,
  5. you must define such a user - the username and password are arbitrary.
  6. -->
  7. <!--
  8. NOTE: The sample user and role entries below are wrapped in a comment
  9. and thus are ignored when reading this file. Do not forget to remove
  10. <!.. ..> that surrounds them.
  11. -->
  12. <!--
  13. <role rolename="tomcat"/>
  14. <role rolename="role1"/>
  15. <user username="tomcat" password="tomcat" roles="tomcat"/>
  16. <user username="both" password="tomcat" roles="tomcat,role1"/>
  17. <user username="role1" password="tomcat" roles="role1"/>
  18. -->
  19. </tomcat-users>

我们在这里加上如下的一句话:

Java代码

  1. <user username="admin" password="admin" roles="admin,manager"/>

修改后的文件为:

Java代码

  1. <tomcat-users>
  2. <!--
  3. NOTE: By default, no user is included in the "manager-gui" role required
  4. to operate the "/manager/html" web application. If you wish to use this app,
  5. you must define such a user - the username and password are arbitrary.
  6. -->
  7. <!--
  8. NOTE: The sample user and role entries below are wrapped in a comment
  9. and thus are ignored when reading this file. Do not forget to remove
  10. <!.. ..> that surrounds them.
  11. -->
  12. <!--
  13. <role rolename="tomcat"/>
  14. <role rolename="role1"/>
  15. <user username="tomcat" password="tomcat" roles="tomcat"/>
  16. <user username="both" password="tomcat" roles="tomcat,role1"/>
  17. <user username="role1" password="tomcat" roles="role1"/>
  18. -->
  19. <user username="admin" password="admin" roles="admin,manager"/>
  20. </tomcat-users>

重新启动tomcat服务器,这时,我们就可以使用用户名为admin,密码为admin的用户登录tomcat的管理界面了,这样,我们可以远程管理tomcat了

tomcat7 请添加如下文件:

<role rolename="manager-gui"/>
<role rolename="admin-gui"/> <user username="admin" password="admin" roles="manager-gui,admin-gui"/>

tomcat使用manager管理app时需要身份验证问题的更多相关文章

  1. 无法在Web服务器上启动调试,与Web服务器通信时出现身份验证错误

    问题描述: 我使用的是修改hosts,模拟真实网址来进行调试的.具体是这样的:我修改hosts文件,把某个域名,如www.163.com映射为127.0.0.1,然后在IIS信息管理器中,创建一个网站 ...

  2. Github官方app分析——用户身份验证模块

    这篇文章记述的是我对Giuhub官方app的用户身份验证模块的分析. Giuhub的官方app虽然是一个非常小众的程序,但是从程序的设计的角度看,这是一个非常优秀的项目.对于其用户身份验证模块,给我留 ...

  3. apache-tomcat-7.0.70无法进入Manager管理App项目

    在tomcat文件夹找到conf文件夹中的tomcat-user.xml文件,用记事本打开,在最下面可以看到tomcat默认把用户注释掉了,也就是说打开tomcat主页是进不去管理页面的.方法如下:找 ...

  4. 解决win7远程桌面连接时发生身份验证错误的方法

    远程桌面连接,是我们比较常用的一个功能了,但有时突然不能用了,以下是我遇到该问题,并解决该问题的方法.连接时报的是“发生身份验证错误,要求的函数不受支持”,解决之后细想一下,该问题好像是在我在电脑上安 ...

  5. 调用WebService时加入身份验证,以拒绝未授权的访问

    众所周知,WebService是为企业需求提供的在线应用服务,其他公司或应用软件能够通过Internet来访问并使用这项在线服务.但在有些时候的某些应用服务不希望被未授权访问,那么此时我们可以一下几种 ...

  6. Github官方app的账户身份验证的实现

    作为github上被fork最多,被star最多的Android项目,实在是没有理由不让我去学习学习的.这篇文章是关于其账户身份验证模块的实现的.如果你对此有兴趣,请移步到我的blog,地址如下: 地 ...

  7. C#调用Web Service时的身份验证

    原理:webservice所在的系统中,在系统域中建立用于登录的软件的用户和密码,软件登录时将用户名.密码和登录的本机的域的名字通过webService的NetworkCredential传递到web ...

  8. 发布 windows 10 universal app 时微软账号验证失败

    具体错误:Visual Studio encountered an unexpected network error and can't contact the Microsoft account s ...

  9. 远程桌面时出现身份验证错误,要求的函数不正确,这可能是由于CredSSP加密Oracle修正

    问题如下: 那么解决办法如下:

随机推荐

  1. Liberty glance 新功能 healthcheck

    oslo.middleware‘s healthcheck http://specs.openstack.org/openstack/oslo-specs/specs/kilo/oslo-middle ...

  2. NSRegularExpression iOS自带的正则表达式

    以前做验证邮箱,电话号码的时候通常用第三方的正则表达式或者NSPredicate(点这里查看以前的文章),在后期,苹果推出了自己的正则表达式来提供给开发者调用,很方便,功能也强大. 具体可以查看官方文 ...

  3. 在CentOS6.4中安装配置LAMP环境的详细步骤 - Leroy-LIZH

    本文详细介绍了CentOS6.4系统中安装LAMP服务并对其进行配置的过程,即安装Apache+PHP+Mysql,参照了网上大神的设置,其他Linux发行系统可以参考~ 在本文中部分命令操作需要ro ...

  4. 51nod 1243 二分+贪心

    http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1243 1243 排船的问题 题目来源: Codility 基准时间限制: ...

  5. 10-THREE.JS perspective透视摄像机和orthographic正交摄像机区别

    <!DOCTYPE html> <html> <head> <title></title> <script src="htt ...

  6. 深入浅出Mybatis系列(九)---强大的动态SQL(转载)

    原文出处:http://www.cnblogs.com/dongying/p/4092662.html 上篇文章<深入浅出Mybatis系列(八)---mapper映射文件配置之select.r ...

  7. c++primer 第五章编程练习答案

    5.9.1 #include<iostream> int main() { using namespace std; ; cout << "input first i ...

  8. LeetCode OJ:Largest Number(最大数字)

    Given a list of non negative integers, arrange them such that they form the largest number. For exam ...

  9. bzoj5457 城市

    一棵树,每个点有一个民族,和一个人数,求每个子树里最多的民族及其人数,如果一样,输出编号最小的 $n \leq 500000$ sol: 卡莫队的毒瘤题,需要 dsu on tree 大概就是 dfs ...

  10. [BZOJ5248][多省联测2018]双木棋chess

    bzoj luogu sol 首先,要保证一个格子的左边和上方都放满了棋子,就需要这个点的左上方那个矩形都放满了棋子. 这样放棋子状态就会是一个自左下至右上的轮廓线. 状态数?\(C_{20}^{10 ...