我已经采购了数字海洋的ubuntu水滴,我在配置访问tomcat管理器时遇到了问题。我已经按照下面的教程一步一步地完成了所有步骤-- https://cloud.digitalocean.com/support/suggestions?article=how-to-install-apache-tomcat-8-on-ubuntu-14-04&page=0&query=tomcat%20manager
实际上,我可以在server-ip:8080上访问tomcat主页,但在manager/html上遇到访问被拒绝的问题
这是我的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 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.
-->
<user username="admin" password="password" roles="manager-gui,admin-gui"/>
</tomcat-users>我尝试了我的用户和角色组合,但每次都被拒绝访问。请帮帮忙
发布于 2016-07-05 17:17:27
您需要为管理器应用程序创建上下文,并允许从Tomcat 8.5.x进行访问
在您的$CATALINA_BASE/conf/Catalina/localhost/主目录下创建文件manager.xml
manager.xml内容,请注意我的来源是172.31.254.37 (我的电脑),请将其更改为您的来源:
<Context privileged="true" antiResourceLocking="false"
docBase="${catalina.home}/webapps/manager">
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="172\.31\.254\.37" />
</Context>确保在$CATALINA_BASE/conf/tomcat-users.xml中定义了您的用户/角色
<user username="tomcat" password="tomcat" roles="manager-gui,manager-status"/>如果需要,您需要对host-manager执行相同的操作
致以亲切的问候,
雅克·德·雅格
https://stackoverflow.com/questions/37838022
复制相似问题