我们可以通过图形用户界面来管理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. dr01_SetColor

    1. TGraphicUnit.SetColor 2. 3.

  2. css页面缩放

    如果原来的宽度是1200, 缩放之后宽度可能就变成了1560, 然后你本来的图片1200可能就开始显示不全了. 如果你的图片按100%显示的话,这个时候又正常了.

  3. 分享知识-快乐自己:Java中的经典算法之冒泡排序(Bubble Sort)

    原理:比较两个相邻的元素,将值大的元素交换至右端. 思路:依次比较相邻的两个数,将小数放在前面,大数放在后面.即在第一趟:首先比较第1个和第2个数,将小数放前,大数放后.然后比较第2个数和第3个数,将 ...

  4. C语言基础三

    C--数组 一维数组的定义和引用 定义:类型说明符 数组名[常量表达式] int a[ 10 ];他表示定义了一个整形数组,数组名为a,有10个元素. 注意:C语言不允许对数组的大小做动态定义. 一维 ...

  5. css3——transition属性和opacity属性

    [transition-duration] 是一个css3属性,规定完成过度效果需要花费的时间(一秒或毫秒计).语法:transition-duration: time;time :    规定完成过 ...

  6. 1008 Envy(好题¥)

    1008: Envy 时间限制: 1 Sec  内存限制: 128 MB提交: 288  解决: 61[提交][状态][讨论版] 题目描述 今年的 ACM 比赛推出了一个赛后的娱乐活动,所有参赛选手排 ...

  7. 关于设置UITableView的背景图片

    在UITableViewController中,要设置UITableView的背景图片,以前常用的方法是使用backgroundcolor属性,这个属性可以通过UIImage来获取,但最近发现这个方法 ...

  8. LeetCode OJ:Construct Binary Tree from Inorder and Postorder Traversal(从中序以及后序遍历结果中构造二叉树)

    Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that ...

  9. 条款51:编写new以及delete的时候需要固守常规

    C++中delete一个指针之后,只是回收指针指向位置的空间,而指针本身的值不变.你需要手工将其赋值为NULL.注意的一点是delete NULL指针的时候不会有任何的事情发生   小结:     o ...

  10. angular复选框式js树形菜单(一)

    treeView.html <ul class="tree-view"> <li ng-repeat="item in treeData" n ...