In this tutorial we will show you how to Set up WebDAV using Apache on CentOS 7 server. For those of you who didn’t know, WebDAV (Web-based Distributed Authoring and Versioning) is an Extension of the HTTP protocol that allows users to edit and manage files and documents stored on servers.
WebDAV provides a frame for users to create, alter, move, Upload, and download documents on an Apache web server. This makes WebDAV a favorite choice for programmers, especially when combined with Subversion or Git.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step set up WebDAV using Apache on CentOS 7 server.
Set up WebDAV using Apache on CentOS 7
Step 1. First let’s start by ensuring your system is up-to-date.
yum clean all
yum -y install epel-release
yum -y update
Step 2. Installing Apache web server.
Install Apache using YUM:
yum install httpd
Start the Apache web server:
systemctl start httpd.service
systemctl enable httpd.service
For Apache, there are three WebDAV-related modules which will be loaded by default when a Apache web server getting started. You can confirm that with this command:
httpd -M | grep dav
You should be result with:
After installing the WebDAV module, you will need to create a webdav directory:
chown -R apache:apache /var/www/html
chmod -R 755 /var/www/html
Set up password authentication:
htpasswd -c /etc/httpd/.htpasswd chedelics
Now, you need to assign group ownership of the file to the apache user, and lock down the permissions for everyone else. To do this, run the following command:
chown root:apache /etc/httpd/.htpasswd
chmod 640 /etc/httpd/.htpasswd
Next, you need to create a virtual host file for the webdav directory:
Add the following content:
CustomLog /var/log/httpd/access.log combined
Alias /webdav /var/www/html/webdav
Save and exit, Restart Apache to put your changes into effect:
systemctl restart httpd.service
WebDAV will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://mydomain.com/webdav and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.
Congratulation’s! You have successfully installed WebDAV using Apache on CentOS 7. Thanks for using this tutorial for set up WebDAV using Apache on CentOS 7 systems. For additional help or useful information, we recommend you to check the official WebDAV web site.