WebDAV on Ubuntu 12.04 LTS x64 (for xbmc)

For you people who are interested in setting up webdav but having difficulties doing it. I have made a guide beneath which covers all the steps in setting it up.

Note: Im currently still figuring how to create various users with different rights. So this will only cover a basic installation with SSL and a user with all permissions.

I’m assuming you have already installed a basic version of Ubuntu with LAMP. if not, please google for a guide which covers this.

Don’t forget to open ports 80 en 443 (http and ssl) in your firewall

Step 1: Creating an SSL certificate (we’ll need it later on)

The first step is to create the SSL certificate and SSL key needed by your Apache server. These will be used to secure the transmission. The SSL certificate will have a .crt extension and the SSL key a .key extension.

To create these to files, you first need to create your local authority file by shooting these commands :

You will be prompted for a passphrase. Then you need to answer few questions about your server.

It is very important that you define the Common Name (CN) with your server public URL (yourserver.dyndns.org).
As your Webdav share will be accessible from Internet, the CN should be set with your public IP address or better, with your public DNS name (DynDNS for example).
If you don’t do so, your site URL and your generated certificate won’t match.

Then, you have to create the certificate and the key file with these commands :

Your certificate will be valid 3650 days (10 years).

Last step is to copy these 2 files in the Apache configuration folder :

Step 2: Create your WebDAV folder
First install the following module for apache:

I suppose that your Apache web root is the standard /var/www.

We will create the WebDav root in /var/www/webdav and make the Apache user (www-data) the owner of that directory.

All your files accessible will be located under that WebDav root.

Step 3: Configure WebDav & enable the modules

Next we will create the WebDAV password file for a test user.

For security reasons, the file should not be accessible from the webdav shared directory.
We will create it in the .htpasswd file of Apache2

Enabling the necessary modules:

Step 4: Setup the SSL host

And There you have it, a basic setup for WebDAV in ubuntu linux. For questions and suggestions please comment underneath!

Step 5: Testing

Download the DAV client from:

Resources:

  • http://www.server-world.info/en/note?os=Ubuntu_12.04&p=httpd&f=7
  • http://bernaerts.dyndns.org/linux/62-debian-webdav-share

Leave a Reply

Your email address will not be published. Required fields are marked *