您的位置:首页 > 运维架构 > Tomcat

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

2012-10-09 22:27 344 查看
安装文件夹下面找到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管理了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: