apache - 在 tomcat 7 中登录管理器 webapp 显示错误

标签 apache tomcat authentication tomcat7

在我的 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/

相关文章:

php - 登录后Opencart登录到上一个查看的页面?

apache - 如何杀死 apache(老一代)进程

java - 是否可以为tomcat数据源设置多个url

java - 无法将单个 XML 文件添加到 Tomcat 的类路径

java - Spring源码超时导致Tomcat启动失败

javascript - 无法弄清楚我的 JavaScript 代码出了什么问题

python - 为什么我从 urllib2 发出的请求被 Apache2 延迟了?

node.js - 当我启动 .js 服务器文件时出现错误 : connect ECONNREFUSED into node. js

apache - 如何防止两个链接显示与.htaccess 相同的内容?

php - 通过 Chrome 扩展使用 PHPAuth/PHPAuth 登录网站