我们可以通过图形用户界面来管理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. Python给数字前固定位数加零

    python中有一个zfill方法用来给字符串前面补0,非常有用 n = " s = n.zfill(5) " zfill()也可以给负数补0 n = "-123&quo ...

  2. 读写properties文件方法

    按key读取properties文件中的value public static String readSystemConfig(String key){ Properties prop = new P ...

  3. VMware Workstation Pro v14.0

    早些时候戴尔旗下的虚拟化软件 VMware Pro v14 版正式发布,本次更新主要是优化对创意者更新版的支持. 创意者更新版是目前微软 Windows 10 系统的最新版本,该版本亦会在十月份成为C ...

  4. 【VS2013编译DirectX Tutorials时遇到的错误】"const wchar_t *" 类型的实参与 "LPCSTR" 类型的形参不兼容

    本文为大便一箩筐的原创内容,转载请注明出处,谢谢:http://www.cnblogs.com/dbylk/p/3696367.html 通过查看LPCSTR的定义: typedef _Null_te ...

  5. Windows下载安装虚拟机和CentOS7

    1,想要在Windows系统中安装linux系统,首先需要安装一个虚拟机VMware VMware 12下载地址:https://my.vmware.com/cn/web/vmware/info/sl ...

  6. 让您的Chrome浏览器允许本地环境支持Ajax

    对于网站前端人员来说,我们在本地开发程序的时候如果用到Ajax的话,通常会使用Firefox来测试,因为Firefox的安全策略支持本地Ajax,IE系列和Chrome都不支持. 不过,经过笔者亲身体 ...

  7. ImageSwitcher的简单使用

    测试代码: activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <Linear ...

  8. android Application Project目录结构

    src:存放java源文件 gen: 资源配置文件 Android4.0: 4.0 类库 Android Private Lib: 支持库 Android Dependencies: android ...

  9. LeetCode OJ:Length of Last Word(最后一个词的长度)

    Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the l ...

  10. 是因为Session只能让服务器在一次连续的会话中记住你,而Cookie是记住浏览器一段时间

    Cookie的作用 因为http协议先天不足是无记忆性. 还有一个区别是:Session是服务器端保存会话状态的机制. 而Cookie则是浏览器端保存会话的机制. Cookie 的应用