How to Set up/Install WebDAV on Ubuntu 15.10 with Apache2!!!

This blog will step you through the correct setup for WebDAV on Ubuntu. There is a lot of examples online which half explain or are cut and past of the other post on it or from – – this guide will show you how to set up WebDAV and save yourself on permissioning issue and access rejections; it will show you the correct configuration for assuming you have the cname, a record or/and aaaa records of: pointed to the Ubuntu service.

First once you are in Ubuntu, press alt + ctrl + t to enter the shell bash prompt and run the following commands:-

sudo apt-get update
sudo apt-get install apache2 apache2-utils nano

Now we have to make the path the webdav operates on this can be in your home directory if you like but for the moment we will make it in /var/www; run the following commands:-

sudo mkdir /var/www/webdav
sudo chown -R www-data:www-data /var/www/

Next run the following commands to enable Web Dav with apache 2:-

sudo a2enmod dav
sudo a2enmod dav_fs

Now we have to make the apache2 config file for run the following command:-

sudo nano /etc/apache2/sites-available/

and put the following text in there changing any section in bold, that you know needs to change:-

<VirtualHost *:80>
    DocumentRoot /var/www/webdav
    ErrorLog /var/log/apache2/
    CustomLog /var/log/apache2/ common
    <Directory /var/www/webdav>
         Options Indexes FollowSymLinks MultiViews
         AllowOverride none
         DAV On
         AuthType Basic
         AuthName "Webdisk Authentication for WebDAV (here)"
         AuthUserFile /var/www/
         Require valid-user

now sav in nano by pressing CTRL + O then CTRL + X and then run the following commands:-

sudo htpasswd -c /var/www/ username

This will allow you to set username and passwords for the WebDAV; now it is time to enable the WebDAV and restart apache2; with the following commands:-

sudo a2ensite
sudo ufw allow 80
sudo service apache2 reload
sudo service apache2 restart

So that is is that is how you set up WebDAV Properly so you don’t have access issues and faults, and there is no path after wards to connect to in Ubuntu Desktop you would goto the path dav:// or for the WebDAV path specified!