WebDAV stands for Web-based Distributed Authoring and Versioning. It is a set of extensions to the HTTP protocol which allows users to collaboratively edit and manage files on remote web servers. For more information on WebDAV, consult the FAQsection at their site.
Before you start, this article has the following dependencies:
- You must have the Developer Tools installed.
- You must have SSH access set up for root or a sudo user.
The example used in this article will include a password-protected directory configured in Plesk. This is the simplest, and most secure, method of configuring WebDAV, as it also uses the Plesk Control Panel. Please create this directory first before continuing.
- Log into your server as root using SSH. Make sure that mod_dav is enabled on your server. The (dv) server should have it enabled by default. After running this command, make sure that the LoadModule does not start with a #. The # means that the module is commented out. If necessary, remove the # and restart httpd:
grep "LoadModule dav_" /etc/httpd/conf/httpd.conf
- Now, check the WebDAV section in the same httpd.conf file. The location for the DAV lock database must be specified in the global section of your httpd.conf file using the DavLockDB directive. The directory containing the lock database file must be writable by the User and Group under which Apache is running. You should see the following lines in that same file:
# Location of the WebDAV lock database. DAVLockDB /var/lib/dav/lockdb
- Next, we need to create a vhost.conf file, or add to your existing one, that will need to be saved in the/var/www/vhosts/example.com/conf directory. Change the first line accordingly. For this article, we will be using a directory named Dav:
<Directory /var/www/vhosts/example.com/httpdocs/Dav > Dav On AllowOverride none </Directory>
- For WebDAV to work properly, we will also need to change ownership of the Dav directory to the Apache user:
chown -R apache /var/www/vhosts/example.com/httpdocs/Dav
- Reconfigure your webserver so it will look for your new vhost.conf file by running the following commmand:
You should now be able to connect using any WebDAV client! Remember that you need to authenticate using the credentials you configured in Plesk for your directory.