WebDAV sur Apache avec LDAP
De wikiGite
Révision datée du 8 décembre 2008 à 17:58 par Frank (discussion | contributions)
Sommaire
PROCEDURE A REVOIR, TESTEE SEULEMENT AVEC HTPASSWD, EN HTTP
Procédure adaptée Fso 29 septembre 2008 à 11:48 (CEST)
Installation
Apache, OpenSSL
voir procédure Apache2 SSL sur Debian Etch
WebDAV
Le module est déjà installé avec apache2.
Charger le module WebDAV
a2enmod dav a2enmod dav_fs a2enmod dav_lock a2enmod rewrite
dav_fs charge par défaut le module dav.
Déclarer WebDAV
On crée d'abord un répertoire pour les partages :
mkdir /home/pub
Dans /etc/apache2/sites-enabled/000-default, remplacer "NameVirtualHost *" par :
NameVirtualHost *:80 NameVirtualHost *:443 DAVMinTimeout 600 DAVDepthInfinity On
Attention, à partir du moment où on a activé SSL, tous les VirtualHosts doivent être assignés soit au port 80 soit au port 443.
Créer le fichier /etc/apache2/sites-availables/webdav :
# To force redirect to SSL VH, uncomment :
#<VirtualHost *:80>
# ServerName mondomaine
# RewriteEngine on
# RewriteCond %{HTTPS} !=on [NC]
# RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
#</VirtualHost>
<VirtualHost *:443>
ServerName mondomaine
ServerAdmin webmaster@mondomaine
SSLEngine On
# If we have a real certificat, give the Authority :
#SSLCACertificateFile /etc/ssl/certs/cacert_class3.crt
SSLCertificateFile /etc/apache2/ssl/mondomaine.crt
SSLCertificateKeyFile /etc/apache2/ssl/mondomaine.key
DocumentRoot /var/www
<Directory />
Options -Indexes FollowSymLinks
AllowOverride none
</Directory>
DAVLockDB /var/lib/apache2/DAVLockDB
Alias /pub /home/pub/
<Location /pub>
DAV On
AuthType Basic
AuthName "WebDAV"
AuthBasicProvider ldap
AuthLDAPURL "ldap://127.0.0.1/ou=people,[your base here]”
AuthLDAPRemoteUserIsDN off
ForceType text/plain
Require valid-user
Require ldap-filter &(uid=*)
</Location>
ErrorLog syslog
LogLevel warn
CustomLog /var/log/apache2/access_dav.log combined
</VirtualHost>
ANCIENNE VERSION
Puis dans /etc/apache2/conf/dav.conf
<Directory /var/www/dav/>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
allow from all
DAV On
# Si on a des messages "HTTP redirect" à la connexion linux, ajouter :
DavDepthInfinity On
SetEnv redirect-carefully 1
AuthType Basic
AuthName "webdav"
AuthUserFile /var/www/dav/passwd.dav
Require valid-user
</Directory>
On créé le fichier de mots de passe avec un user test
#htpasswd -c /var/www/dav/passwd.dav test
C'est maintenant accessible via navigateur et connexion WebDAV (linux, XP...)
