为什么 tomcat-users.xml 被忽略了?

Why is the tomcat-users.xml getting ignored?

Windows 7 TomEE-plume 1.7.4(本地) Fedora 23 TomEE-Plume 1.7.4(远程) 火狐 46

http://localhost:8080 http://192.168.0.100(在 Fedora 23 上远程)

Apache Tomcat (TomEE)/7.0.68 (1.7.4) 页面在本地和远程实例上都运行良好。

我已尽职调查阅读 TomEE 文档和互联网搜索。
在本地 Windows 实例中,当单击以下任何按钮时,浏览器将直接转到该页面。但是在 TomEE 的远程实例上,按下相同的按钮会导致弹出一个小的登录对话框。 tomcat-users.xml文件中只有一个用户id。当使用用户标识和密码时,访问被拒绝。据我了解,用于 运行 TomEE-plume 的 Fedora id 应配置为 "nologin"。

问题 1) 我说的 Fedora id 用于 运行 TomEE-plume 应该配置为 "nologin" 是否正确? 问题2)为什么tomcat-users.xml中的id不能用?

<?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="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
-->
  <!-- Activate those lines to get access to TomEE GUI -->
  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <role rolename="manager-status"/>
  <role rolename="manager-jmx"/>
  <user username="tomee" password="mypassword" roles="manager-gui,manager-script,manager-status,manager-jmx" />
</tomcat-users>

只是在这里重复你已经知道的答案,这样这个问题就不会因为没有答案而出现。不需要 select 这是正确答案。

tomcat-users.xml 确实只在启动时读取,您必须反弹 JVM 才能拾取更改。如果您希望能够动态地 add/remove 用户,或者在不重新启动 JVM 的情况下更改他们的角色,请考虑使用 LDAP 支持的安全存储库。您可以按照此处的说明执行此操作:https://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#JNDIRealm