tomcat 修改用户名密码
tomcat? wep mangement 用户设置
?
tomcat默认是将用户是注释的
?配置文件在根目录下$TOMCAT_HOME/conf/tomcat-users.xml文件中
?
配置默认如下:
?
<!--
? <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"/>
-->
?
将注释去掉,并将角色修改为manager
?
<role rolename="manager"/>
<user username="tomcat" password="tomcat" roles="manager"/>
?
重启tomcat就ok了
?
例子
假设我要添加管理员账号haha,密码为haha.
新xml如下:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="haha" password="haha" roles="admin,manager"/>
</tomcat-users>
?
?
?
?