tomcat 登录时用户名和密码问题

来源:互联网 发布:mac照片如何导入iphone 编辑:程序博客网 时间:2024/05/17 01:44
安装文件夹下面找到tomcat-users.xml文件,一般情况下实在这样一个文件目录下面的  D:\Program Files\Apache Software Foundation\Tomcat 6.0\conf;
最后用记事本打开tomcat-users.xml文件,内容大概如下:
<?xml version='1.0' encoding='cp936'?>
<tomcat-users>
<!--
  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"/>
</tomcat-users>

这里我们发现没有manager的权限,而我们需要的就是在manager中操作,所以我们要创建一个manager的管理权限如下面红色部分


<?xml version='1.0' encoding='cp936'?>
<tomcat-users>
<!--
  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"/>

<user username="admin" password="admin" roles="manager"/>
</tomcat-users>

这样的话保存后关闭,然后重新启动tomcat就可以使用 用户名:admin  和密码:admin来登录manager管理了
原创粉丝点击