我有一个服务器,目前使用htpasswd来validation用户。 我正在迁移到使用LDAP,但我的LDAP服务器仅用于用户身份validation,不允许我添加组。
我仍然需要使用通过我的configuration中的Apache Directory标签进行访问控制的组。 另一种方法是重新访问访问控制,使用PHP或类似的东西来限制访问。
这适用于“基本”身份validation
<Directory /misc/www/html/site> #LDAP & other config stuff irrelevant to issue Require ldap-group cn=<service>,ou=Groups,dc=<service>,dc=<org>,dc=com </Directory>
尝试
<Directory /misc/www/html/site> #LDAP & other config stuff irrelevant to issue #groups file from previous configuration using htpasswd #tried to tweak to match new user format, but I don't think it looks up in here AuthGroupFile /misc/www/htpasswd/groups #added the group, which is how it works when using htpasswd Require ldap-group cn=<service>,ou=Groups,dc=<service>,dc=<org>,dc=com group xyz </Directory>
正如@EJP所指出的,最好的解决scheme是将这些组放在LDAP中。 但是,要回答您的问题,您可以将计算机join到LDAP服务器,以便LDAP帐户成为操作系统用户。 然后你可以把用户放在操作系统组(即在Unix上的/etc/group )并使用mod_authz_unixgroup 。