我已经在服务器上运行了Nagios(CentOS 5.3 w / Apache 2.2.3-22.el5.centos),并对我的LDAP服务器进行了身份validation,并且运行良好。 但是,我想有一些IP能够看到Nagios状态页面,而无需身份validation。 Nagios有这个选项可以将用户分配给不authentication的用户:
authorized_for_read_only=guest default_user_name=guest
这听起来是正确的,但是这不关心Apacheauthentication。 我目前的Apacheconfiguration如下所示:
<Directory "/usr/lib64/nagios/cgi"> AllowOverride None Order allow,deny Allow from all AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/nagios/misc/htpasswd.users Require valid-user AuthBasicProvider file ldap AuthzLDAPAuthoritative off AuthBasicAuthoritative On AuthLDAPGroupAttribute LDAPmember AuthLDAPURL (my server stuff) Require ldap-group CN=nagios,ou=groups,DC=local </Directory>
这是行得通的,但我想用某种方式说“这个IP在这里,他可以跳过这个authentication的东西”。 Apache Satisfy指令看起来好像可以工作,所以我尝试了这个:
<Directory "/usr/lib64/nagios/cgi"> AllowOverride None Order allow,deny Allow from (IP) <---- changed Deny from all <---- changed Satisfy any <---- changed AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/nagios/misc/htpasswd.users Require valid-user AuthBasicProvider file ldap AuthzLDAPAuthoritative off AuthBasicAuthoritative On AuthLDAPGroupAttribute LDAPmember AuthLDAPURL (my server stuff) Require ldap-group CN=nagios,ou=groups,DC=local </Directory>
但是这并没有改变网站的行为。 思考? “对我有用”? 指出适当的升级说明,说如果我有升级服务器,我会解决这个问题? 🙂
—-更新w / answer —-
我拿出了文件或LDAP的东西,并满意为我工作。 我可能在那里做错了什么,但是不pipe怎么样,现在都行得通了。 这是我最后的configuration看起来像:
<Directory "/usr/lib64/nagios/cgi"> Options ExecCGI AllowOverride None Order allow,deny Allow from 192.168.42.213 Satisfy any AuthName "Nagios Access" AuthType Basic AuthBasicProvider ldap AuthzLDAPAuthoritative off AuthBasicAuthoritative On AuthLDAPGroupAttribute LDAPmember AuthLDAPURL (my server stuff) Require ldap-group CN=nagios,ou=groups,DC=local </Directory>
“满足任何”的确是你需要使用的。 Apache wiki上有一个很好的例子 。 直接从这个来源引用:
<Directory /home/www/site1/private> AuthUserFile /home/www/site1-passwd AuthType Basic AuthName MySite Require valid-user Order allow,deny Allow from 172.17.10 Satisfy any </Directory>