Skip to content

Installing WebDAV

tago edited this page Apr 25, 2024 · 13 revisions

How to Install and Setup WebDAV on Linux for Flare

WebDAV (Web Distributed Authoring and Versioning) is an extension of the HTTP protocol that allows users to collaborate and manage files on a remote server. In this guide, you will learn how to install and set up WebDAV on Linux to create a data sharing website in order to use Flare, instead of using GitHub and Netlify.

Update and Upgrade Packages

  1. Open the terminal.
  2. Update the package list and upgrade the installed packages:
    sudo apt update && sudo apt upgrade

Install Apache Web Server

  1. Install Apache using the following command:
    sudo apt install apache2 -y
  2. Verify that Apache is installed by opening a web browser and entering your server's IP address. If you see the Apache default page, Apache is successfully installed.

Install WebDAV

  1. Enable the dav and dav_fs modules for Apache:
    sudo a2enmod dav
    sudo a2enmod dav_fs
  2. Restart Apache to apply the changes:
    sudo systemctl restart apache2.service

Create a Data Storage Folder

  1. Create a folder to store the data. For example, we will create a folder named 'accs':
    sudo mkdir /var/www/accs
  2. Set the ownership of the webdav folder to the Apache user (www-data):
    sudo chown www-data:www-data /var/www/accs
  3. Ensure that the 'accs' directory has the correct permissions for uploading and downloading files.

Configure Apache for WebDAV

  1. Edit the Apache configuration file for the default site:

    sudo nano /etc/apache2/sites-available/000-default.conf
  2. Inside the <VirtualHost> block, add the following configuration for the webserver 'accs' directory:

    Alias /accs /var/www/accs
    <Directory /var/www/accs>
        DAV On
        <LimitExcept POST>
            deny from all
        </LimitExcept>
    </Directory>
    
  3. Save the changes

  4. Restart Apache to apply the changes to the webserver:

    sudo systemctl restart apache2.service
  5. Port forward the necessary ports to publicly access your Apache webserver

Clone this wiki locally