无计留春住
2014-11-25 13:32
求对策
<?xml version='1.0' encoding='utf-8'?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <tomcat-users xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" version="1.0"> <!-- 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-gui"/> <role rolename="manager-jmx"/> <role rolename="manager-status"/> <user username="tomcat" password="123456" roles="manager-status"/> </tomcat-users>
在tomcat-users.xml中配置账号密码后,记得重启tomcat,修改的东西才有效
为什么设置好了用户名和密码之后可以进入后台,但再次重启tomcat用户名就登录不上了?失效了!!! tomcat-users.xml里面也没有了刚刚的配置!
.o0.0o. 哈哈 谢谢
O(∩_∩)O非常感谢!~
<?xml version='1.0' encoding='utf-8'?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <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. --> <!-- 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="manager-gui"/> <user username="tomcat" password="tomcat" roles="manager-gui"/> <!-- <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>
<role rolename="manager-gui"/>
<user username="tomcat" password="123" roles="manager-gui"/>
直接在tomcat-user.xml文件中的<tomcat-users></tomcat-users>之间加入上面这一句即可,这句话的意思是吧用户名设置为tomcat,密码设为123。
不要把<!-- -->这个符号去掉,这里是注释,举例说明你可以把名字密码设置为各种类型。
我只加了一个角色manager-gui就可以访问了,role="admin-gui"是什么意思,也是系统里内置的么?@诺颜宁
非常感谢,已成功.
打开Tomcate安装文件中的conf文件夹,之后打开tomcat-users.xml文件,在<tomcat-users></tomcat-users>的标签之间j加入一下代码,此时你的用户名和密码是admin,这样就可以实现你想要的了
查看Server status,用户名和密码不管用..所以请教.
你是要启动tomcat吗?配置一下环境直接启动就可以了,不知道你要用户名密码干吗
改了之后还是不管用啊.
想要修改tomcat的用户名及密码的方法:
打开Tomcate安装文件中的conf文件夹,之后打开tomcat-users.xml文件,在<tomcat-users</tomcat-users的标签之间,添加一句话:
<user username="admin" password="admin"
重新启动tomcat服务,那么新的用户名和密码就是:admin和admin
JAVA遇见HTML——JSP篇
248277 学习 · 3071 问题
相似问题