Set up WebDAV server - how it works
You can quickly set up a WebDAV server in just a few simple steps. Find out exactly how to do this in this practical tip.
Setting up a WebDAV server - how it works on Linux
- Connect to your server via SSH and first enter the command "sudo a2enmod dav sudo a2enmod dav_fs". Confirm with [Enter].
- Create the appropriate directory with "sudo mkdir / var / webdav" and adjust the access rights with "sudo chown -R www-data: www-data / var / webdav".
- The command "sudo nano / etc / apache2 / sites-enabled / 000-default.conf" loads the configuration file into the editor. Add the following above "Virtual Host": "Options Indexes MultiViews AllowOverride None Order allow, deny allow from all".
- Make a paragraph and add the following: "Alias / webdav / var / webdav / DAV on Options + Indexes AuthType Basic AuthName DAV AuthUserFile / etc / apache2 / webdav Require valid-user". Save with [Ctrl] + [O] and exit with [Ctrl] + [X].
- Using "sudo htpasswd -c / etc / apache2 / webdav name" you create the user name and password for the directory. Once you have done this, restart the web server with "sudo service apache2 restart".
Secure WebDAV server with SSL
- Since the content is transmitted unencrypted, you should encrypt it using SSL.
- Create with "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 appropriate SSL certificate.
- With "sudo a2enmod ssl" the SSL module is activated on the server.
- Copy the file "/ etc / apache2 / sites-available / 000-default.conf" to your PC and open it on the server with "nano / etc / apache2 / sitesavailable / webdav-ssl.conf". Change the entry "" to "".
- Also add the following: "SSLEngine on SSLCertificateFile / etc / ssl / certs / apache.crt SSLCertificateKeyFile /etc/ssl/private/apache.key".
- To apply the changes, restart the web server with "sudo service apache2 restart".
- This completes the setup successfully.
In the next practical tip, read how you can set up Webdav under Windows 10.