WebDAV or the Web-based Distributed Authoring and Versioning is the extension of the HTTP protocol which enables you to manage and edit your documents and files on your web servers. WebDAV Apache setups have become important parts of document sharing and serving. Furthermore, it offers a framework which can help you to modify, create, upload, transfer, and download your documents on Apache webserver.

WebDAV Apache

Well, do you want to know how to set up WebDAV to Apache? Don’t worry because you are in the right place. The following ideas will guide you through setting up the WebDAV on Apache on CentOS 7.
First, you must know the requirements for the setup.

Requirements for WebDAV Apache Installation

You need to have a static IP address on your server, and a server which runs CentOS v.7 with an Apache installed to it.
Step by step process for WebDAV Apache

Installation of the WebDAV Apache module

In this process, you will know how to install Apache on CentOS 7 by default.

Make sure that the WebDAV module is functioning with this command:

  • sudo httpd – M | grep fs

Once the WebDAV is activated, you can see this output:

  • dav_fs_module (shared)

WebDAV Apache directory configuration

The next step is to make a WebDAV director under the Apache web root directory.

  • sudo mkdir / var/www/html/webdav

You can now modify the ownership to (apache user) and you will see the permissions on the director with these commands:

  • sudo chown – R apache: apache/ var/www/html/ webdav
  • sudo chmod – R 755 / var/ www/html/ webdav

Setting up your password authentication

Creating a password is crucial for securing your WebDAV directory. You can set up your password by making an .htpasswd file.
You can create a password with this command:

  • sudo htpasswd – c / etc/httpd/.htpasswd dev

After this, you must assign group ownership to the apache user’s file and lock down the permissions to everyone. You can do this with these commands:

  • sudo chown root: apache / etc/httpd/.htpasswd
  • sudo chmod 640 / etc/ httpd/ .htpasswd

Apache Vhost for WebDAV configuration

You must establish a virtual hose file for your WebDAV directory. You can do this by making a new site configuration file known as the WebDAV.conf.

  • sudo nano / etc/ httpd/conf.d/webdav.conf

You can also include this content:

DavLockDB / var/ www/html/ DavLock
<VirtualHost *:80.
ServerAdmin [email protected]
DocumentRoot/ var/www/html/webdav/
ErrorLog / var /log/httpd/error.log
CustomLog/ var/log/httpd/access.log combined
Alias/ webdav/ var/www/html/webdav
<Directory/ var/www/html/webdav>
DAV On
AuthType Basic
AuthName “webdav”
AuthUserFile/ etc/httpd/.htpasswd
Require valid-user
</Directory>
</VirtualHost>

You can now refresh the Apache for the activation of the new configuration:

  • Sudo apachetl restart

Test WebDAV Apache Server Setup

webdav apache

You can now test the WebDAV Apache. You can test it using a web browser by navigating to the URL http://your.server.ip/webdav/. You will be incited for your username and password which can enable you to access the WebDAV.

By following the above steps, you can now set up the WebDAV with an Apache Web Server successfully on CentOS 7. You can also test the WebDAV to your virtual environment. Setting up WebDAV on Apache is easy. You need the patience to perform the above steps to meet your WebDAV Apache needs.

Photo Credit:
DON JACKSON-WYATT