How to Setup WebDAV Server on Oracle Linux 8

WebDAV (Web Distributed Authoring and Versioning) is a part of Apache HTTP Server software.

a) Installing The Apache HTTP Server

Install the Apache HTTP Server.
sudo dnf module install httpd

b) Enabling Autostart

To tell systemd to start httpd service automatically at boot, enable it.
sudo systemctl enable httpd.service

c) Disabling Default Web Page

(This step is optional.)
sudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf

d) Disabling Default File Listing

(This step is optional.)
sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf

e) Making Directory

Create a directory named webdav from which you want to serve.
sudo mkdir /var/www/html/webdav

f) Transferring Ownership

Transfer the ownership of the webdav directory and its subdirectories and contents to apache user recursively.
sudo chown -R apache:apache /var/www/html/webdav

g) Assigning Permissions

Assign read and execute access for all users and also write access for the owner (apache) of the webdav directory and its subdirectories and contents recursively.
sudo chmod -R 755 /var/www/html/webdav

h) Creating A WebDAV User

Create an WebDAV user and assign a password to it.
sudo htpasswd -c /etc/httpd/.htpasswd test_user

i) Creating Virtual Host

Edit or create the /etc/httpd/conf.d/webdav.conf file on your favorite text editor with superuser privileges and populate the file with the configuration below.

Alias /webdav /var/www/html/webdav

    DAV On
    AuthType Basic
    AuthName "WebDav Authorization Required"
    AuthUserFile /etc/httpd/.htpasswd
    Require valid-user

j) Starting

Start the httpd service.
sudo systemctl start httpd.service
The web server will load WebDAV modules and start listening on port 80 by default.

k) Leeting FirewallD to Know

You may have to add the port to the FirewallD‘s allow list. Adding the http service would do so.
sudo firewall-cmd --zone=public --permanent --add-service=http
Then reload the FirewallD.
sudo firewall-cmd --reload


Documentation

Abdullah As-Sadeed

Abdullah As-Sadeed