WebDAV (Web Distributed Authoring and Versioning) is an extension of HTTP 1.1 and therefore can be considered to be a procotol. It contains a set of concepts and accompanying extension methods to allow read and write across the HTTP 1.1 protocol. Instead of using NFS or SMB, WebDAV offers file transfers via HTTP.
The goal of this how to is to setup a simple WebDAV configuration using a web server.
Install the Apache HTTP Server.
Uncomment the modules for DAV:
LoadModule dav_module modules/mod_dav.so LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule dav_lock_module modules/mod_dav_lock.so
Add the following line to
Make sure you add it outside of any other directives, for instance right under the
Next, add the following (also outside of any directives):
Alias /dav "/home/httpd/html/dav" <Directory "/home/httpd/html/dav"> DAV On AllowOverride None Options Indexes FollowSymLinks Require all granted </Directory>
Create the directory:
# mkdir -p /home/httpd/DAV
Check the permissions of DavLockDB's directory and ensure it is writable by the webserver user
# chown -R http:http /home/httpd/DAV # mkdir -p /home/httpd/html/dav # chown -R http:http /home/httpd/html/dav
Install the package .
After installation, test the WebDAV server:
# cadaver http://localhost/dav dav:/dav/> mkcol test Creating `test': succeeded. dav:/dav/> ls Listing collection `/dav/': succeeded. Coll: test
There are numerous different protocols you can use:
# basic form: htdigest -c /path/to/file AuthName username htdigest -c /etc/httpd/conf/passwd WebDAV username
# basic form: htpasswd -c /path/to/file username htpasswd -c /etc/httpd/conf/passwd username
httpd.conf must be edited to enable authentication. One method would be to require the user
foo for everything:
<Directory "/home/httpd/html/dav"> DAV On AllowOverride None Options Indexes FollowSymLinks AuthType Digest # substitute "Basic" for "Digest" if you used htpasswd above AuthName "WebDAV" AuthUserFile /etc/httpd/conf/passwd Require user foo </Directory>
If you want to permit everybody to read, you could use this in your httpd.conf
<Directory "/home/httpd/html/dav"> DAV On AllowOverride None Options Indexes FollowSymLinks AuthType Digest # substitute "Basic" for "Digest" if you used htpasswd above AuthName "WebDAV" AuthUserFile /etc/httpd/conf/passwd Require all granted <LimitExcept GET HEAD OPTIONS PROPFIND> Require user foo </LimitExcept> </Directory>
Do not forget to restart apache after making changes!
# systemctl restart httpd