tomcat设置登陆用户名密码

来源:互联网 发布:刑事科学技术知乎 编辑:程序博客网 时间:2024/05/18 03:52

在<tomcat-users>之间添加

<role rolename="manager-gui"/>    <role rolename="manager-script"/>    <role rolename="admin"/>    <user password="admin123456" roles="manager-gui,manager-script,admin" username="admin"/>

用户名admin,密码都是admin123456


效果:

<tomcat-users><!--  NOTE:  By default, no user is included in the "manager-gui" role required  to operate the "/manager/html" web application.  If you wish to use this app,  you must define such a user - the username and password are arbitrary. It is  strongly recommended that you do NOT use one of the users in the commented out  section below since they are intended for use with the examples web  application.--><!--  NOTE:  The sample user and role entries below are intended for use with the  examples web application. They are wrapped in a comment and thus are ignored  when reading this file. If you wish to configure these users for use with the  examples web application, do not forget to remove the <!.. ..> that surrounds  them. You will also need to set the passwords to something appropriate.--><!--  <role rolename="tomcat"/>  <role rolename="role1"/>  <user username="tomcat" password="<must-be-changed>" roles="tomcat"/>  <user username="both" password="<must-be-changed>" roles="tomcat,role1"/>  <user username="role1" password="<must-be-changed>" roles="role1"/>--><role rolename="manager-gui"/>    <role rolename="manager-script"/>    <role rolename="admin"/>    <user password="admin" roles="manager-gui,manager-script,admin" username="admin"/></tomcat-users>


0 0
原创粉丝点击