Httpd 和 LDAP 身份验证不适用于子页面

Httpd 和 LDAP 身份验证不适用于子页面

我最近刚刚安装了 Nagios 实现,并且正在尝试使 LDAP 身份验证在 Red Hat 上为 httpd 工作。(下面的 Apache 配置的 nagios.conf,当然是经过清理的)

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
#SSLRequireSSL
Options ExecCGI
AllowOverride none
AuthType Basic
AuthName "LDAP Authentication"
AuthLDAPURL "ldap://my.domain.controller:389/OU=Users,DC=my,DC=domain,DC=controller?sAMAccountName?sub?(objectClass=user)" NONE
AuthzLDAPAuthoritative off
AuthLDAPBindDN "CN=NagiosAdmin,DC=my,DC=domain,DC=controller"
AuthLDAPBindPassword "myPassword"
require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory /usr/local/nagios/share>
#SSLRequireSSL
Options None
AllowOverride none
AuthBasicProvider ldap
AuthType Basic
AuthName "LDAP Authentication"
AuthzLDAPAuthoritative off
AuthLDAPURL "ldap://my.domain.controller:389/OU=Users,DC=my,DC=domain,DC=controller?sAMAccountName?sub?(objectClass=user)" NONE
AuthLDAPBindDN "CN=NagiosAdmin,DC=my,DC=domain,DC=controller"
AuthLDAPBindPassword "myPassword"
require valid-user
</Directory>

现在,初始身份验证已成功,因此当您首次访问该页面时,您可以顺利登录。但是,当您访问其他任何地方时,系统都会提示您进行身份验证,然后失败(要求重新提示),并显示以下错误消息:

[Mon Oct 21 14:46:23 2013] [error] [client 172.28.9.30] access to /nagios/cgi-bin/statusmap.cgi failed, reason: verification of user id '<myuseraccount>' not configured, referer: http://<nagiosserver>/nagios/side.php

我几乎可以肯定这是一个简单的标志或选项,但我就是找不到它,而且我没有太多使用 Apache 的经验。任何协助或帮助都将不胜感激。

答案1

愚蠢的 apache 配置,我漏掉了一行:

在下面

<Directory "/usr/local/nagios/sbin">

我忘了输入

AuthBasicProvider ldap

这真让人恼火。希望未来其他人也能从中受益。

相关内容