Utiliser le module auth_ldap.
Le .htaccess qui va bien:
<Files soumission.php> AuthType Basic AuthName "Accès réservé: login/password de l'Ensi de Bourges" AuthLDAPEnabled on AuthLDAPURL ldap://linuxpdc.ensi-bourges.fr/dc=ensi-bourges,dc=fr AuthLDAPAuthoritative on require valid-user </Files>
Doc : http://www.ac-creteil.fr/reseaux/systemes/linux/lamp/tp-apache2-ldap.html
Utiliser le module authnz_ldap.
<Files soumission.php> AuthType Basic AuthName "Accès réservé" AuthBasicProvider ldap AuthLDAPURL ldap://ldap.example.com/dc=example,dc=com AuthLDAPBindDN uid=apache,ou=sysaccounts,dc=example,dc=com AuthLDAPBindPassword mypassword AuthLDAPRemoteUserIsDN off require ldap-filter allowedServices=monitoring #require valid-user </Files>
<Location /> AuthType ldap AuthType Basic AuthName "Admin Only" AuthBasicProvider ldap AuthLDAPURL ldap://127.0.0.1/o=example AuthLDAPBindDN uid=apache,ou=sysaccounts,o=example AuthLDAPBindPassword secret AuthLDAPRemoteUserIsDN off require valid-user </Location>
require ldap-filter allowedServices=myservice
Avec la commande ProxyPass et ProxyPassReverse :
<VirtualHost *> ServerAdmin root@sds-project.fr ServerName webcam.sds-project.fr <Proxy *> AuthType Basic AuthName "Acces authentifie LDAP" AuthBasicProvider ldap AuthLDAPURL ldap://localhost/dc=sds-project,dc=fr AuthLDAPRemoteUserIsDN off require ldap-filter &(uid=*) Order deny,allow Allow from all </Proxy> DocumentRoot /var/www/ RewriteEngine On ProxyPass / http://172.30.3.65/ ProxyPassReverse / http://172.30.3.65/ </VirtualHost>