• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

How to Setup a WebDAV Server Using Apache on CentOS 7

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
86
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Step one: Update the system
  3. Step two: Install Apache
  4. Step three: Setup WebDAV
  5. Step four: Create a virtual host for WebDAV
  6. Step five: Modify firewall rules
  7. Step six: Test the functionality of the WebDAV server from a local machine
  8. Want to contribute?


WebDAV stands for “Web-based Distributed Authoring and Versioning”. It’s an extension of the HTTP protocol that allows users to manage and share files stored on a WebDAV-enabled web server.

This tutorial will show you how to setup a WebDAV server using Apache on a Vultr CentOS 7 server instance.

Prerequisites

  • A Vultr CentOS 7 server instance.
  • A non-root sudo user. You can learn more about how to create a sudo user in this Vultr tutorial.

Step one: Update the system

sudo yum install epel-release
sudo yum update -y
sudo shutdown -r now

After the reboot, use the same sudo user to log in.

Step two: Install Apache

Install Apache using YUM:

sudo yum install httpd

Disable Apache’s default welcome page:

sudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf

Prevent the Apache web server from displaying files within the web directory:

sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf

Start the Apache web server:

sudo systemctl start httpd.service
sudo systemctl enable httpd.service

Step three: Setup WebDAV

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:

sudo httpd -M | grep dav

You should be presented with:

dav_module (shared)
dav_fs_module (shared)
dav_lock_module (shared)

Next, create a dedicated directory for WebDAV:

sudo mkdir /var/www/html/webdav
sudo chown -R apache:apache /var/www/html
sudo chmod -R 755 /var/www/html

For security purposes, you need to create a user account, say it is “user001”, to access the WebDAV server, and then input your desired password. Later, you will use this user account to log into your WebDAV server.

sudo htpasswd -c /etc/httpd/.htpasswd user001

Modify the owner and permissions in order to enhance security:

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

Step four: Create a virtual host for WebDAV

sudo vi /etc/httpd/conf.d/webdav.conf

Populate the file with:

DavLockDB /var/www/html/DavLock
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    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>

Save and quit:

:wq!

Restart Apache to put your changes into effect:

sudo systemctl restart httpd.service

Step five: Modify firewall rules

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload

Step six: Test the functionality of the WebDAV server from a local machine

In order to take advantage of WebDAV, you need to use a qualified client. For example, you can install a program called cadaver on a CentOS 7 desktop:

sudo yum install cadaver

Having cadaver installed, use the following command to access the WebDAV server:

cadaver http://<your-server-ip>/webdav/

Use the username “user001” and the password you setup earlier to log in.

In the cadaver shell, you can upload and organize files as you wish. Here are some examples.

To upload a local file “/home/user/abc.txt” to the WebDAV server:

dav:/webdav/> put /home/user/abc.txt

To create a directory “dir1” on the WebDAV server:

dav:/webdav/> mkdir dir1

To quit the cadaver shell:

dav:/webdav/> exit

If you want to learn more about cadaver, you can look up the cadaver manual in the Bash shell:

man cadaver

or

cadaver -h

This concludes our tutorial. Thank you for reading.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

Install Java SE on CentOS

Next Post

Install DirectAdmin on CentOS 6 or 7

Next Post

Install DirectAdmin on CentOS 6 or 7

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet