Ubuntu: Setting up a WebDAV server - how it works
You can easily set up a WebDAV server on your Ubuntu server. In this practical tip, we will show you exactly how to do this.
Set up a WebDAV server on Ubuntu - so it'll work
- Log in to the Linux server with SSH and enter the command "sudo a2enmod dav sudo a2enmod dav_fs" and confirm your entry with [Enter].
- The appropriate directory for WebDAV is created using "sudo mkdir / var / webdav". Then you have to use "sudo chown -R www-data: www-data / var / webdav" to adjust the folder access rights.
- Now some changes are necessary in the editor. Load the respective file with the command "sudo nano / etc / apache2 / sites-enabled / 000-default.conf" into the editor and add the following lines via "Virtual Horst": "Options Indexes MultiViews AllowOverride None Order allow "Deny allow from all".
- Now make a paragraph and add another one: "Alias / webdav / var / webdav / DAV on Options + Indexes AuthType Basic AuthName DAV AuthUserFile / etc / apache2 / webdav Require valid-user". The changes are saved with the key combination [Ctrl] + [O]. Then press [Ctrl] + [X] to exit the editor.
- For security, you should create a separate user for WebDAV. You can do this with "sudo htpasswd -c / etc / apache2 / webdav name". Customize "Name" with the user name you want. You then have to enter the corresponding password twice.
Further steps: Set up the WebDAV server on Ubuntu
- For security reasons, we recommend that you encrypt your WebDAV server, otherwise the content will be transferred unprotected.
- SSL is suitable for this procedure. Load yourself with the command "openssl genrsa -out /etc/ssl/private/apache.key 2048 openssl req -new -x509 -key /etc/ssl/private/apache.key -days 365 -sha256 -out / etc / ssl / certs / apache.crt "the SSL certificate suitable for your server.
- In order for encryption to work, you must activate the SSL function with the "sudo a2enmod ssl" command.
- Now make a backup of the file "/ etc / apache2 / sites-available / 000-default.conf". Then open it with "nano / etc / apache2 / sitesavailable / webdav-ssl.conf" and adjust the entry "" "to" ".
- Below you must also add "SSLEngine on SSLCertificateFile / etc / ssl / certs / apache.crt SSLCertificateKeyFile /etc/ssl/private/apache.key" so that encryption is applied.
- Finally, restart your web server with "sudo service apache2 restart". The device is then connected.
In our next practical tip, we will show you how you can use WebDAV on Android.