gpt4 book ai didi

jsp - LDAP 与 Tomcat7

转载 作者:行者123 更新时间:2023-11-28 22:30:16 26 4
gpt4 key购买 nike

这对任何人都有效吗,我在互联网上找到了一个又一个指南,但似乎没有任何效果。

我已将以下内容添加到我的/manager/web.inf

  <security-constraint>
<display-name>your web app display name</display-name>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.html</url-pattern>
<url-pattern>*.xml</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Users</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description>your role description</description>
<role-name>Users</role-name>
</security-role>

尝试从根目录打开管理器应用程序时出现以下错误:

404 Not found

The page you tried to access (/manager/status) does not exist.

The Manager application has been re-structured for Tomcat 7 onwards and some of URLs have changed. All URLs used to access the Manager application should now start with one of the following options:

/manager/html for the HTML GUI
/manager/text for the text interface
/manager/jmxproxy for the JMX proxy
/manager/status for the status pages
Note that the URL for the text interface has changed from "/manager" to "/manager/text".

You probably need to adjust the URL you are using to access the Manager application. However, there is always a chance you have found a bug in the Manager application. If you are sure you have found a bug, and that the bug has not already been reported, please report it to the Apache Tomcat team.

404错误???

下面是我能在日志中找到的唯一相关内容:

Mar 18, 2014 10:13:28 AM org.apache.catalina.core.StandardHostValve custom
FINE: Processing ErrorPage[errorCode=404, location=/WEB-INF/jsp/404.jsp]

最佳答案

根据您的问题标题,我猜您想在您的 Tomcat 管理器上设置 LDAP 身份验证。

您不应为了保护管理器而修改管理器 Web 应用程序。在 Java EE 中,安全约束是应用程序的规则,与容器管理的身份验证截然不同。

适当的解决方案是配置容器使用的认证策略,这是一个纯tomcat conf。在 conf/server.xml 中替换默认值 UserDatabaseRealm使用适当的身份验证策略为运行管理器的引擎定义,例如 JNDIRealm用于 LDAP 身份验证。您只需为您的安装指定适当的属性。请注意,默认 conf 指的是使用 conf/tomcat-users.xml 文件的全局资源。

关于jsp - LDAP 与 Tomcat7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22483764/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com