在我的 ubunut 12.04 LTS 机器上安装了 tomcat7,tomcat 安装成功,但是当我尝试登录 manager webapp 时,它要求输入用户名和密码,输入时它也没有让我登录。它给我 401 unauthorized错误页面。
这是我的 tomcat-users.xml
<?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="tomcat"/>
<role rolename="role1"/>
<user username="tomcatadmin" password="123@tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
</tomcat-users>
最佳答案
那不是错误,它是一种状态。您根本没有传递正确的凭据。将用户和一些角色 ( see here) 添加到 tomcat-users.xml,重新启动 Tomcat 并重试。
关于apache - 在 tomcat 7 中登录管理器 webapp 显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24495529/