format_list_bulleted

Pain-free WebDAV Server

dark_mode
Pain-free WebDAV Server
Just httpd, no Go, no Rust, no PHP
webdav
visibility -- public -- group --

Overview

Sometimes you’re facing problems like file synchronizing through classic WebDAV clients (like Zotero) between devices.

KitDisadvantage
NextCloudWritten in PHP and extreme slow.
ownCloudWritten in Go but support OIDC auth only.
nginxIncomplete WebDAV implementation.
caddyRequiring 3rd-party plugin.
httpdThe best and contained in all distro!

In this case we gonna deploy as following:

nginx (reverse proxy) --> httpd (WebDAV) --> filesystem

httpd

Listen plain HTTP.

Listen 2080

LoadModule dav_module "modules/mod_dav.so"
LoadModule dav_fs_module "modules/mod_dav_fs.so"

<VirtualHost *:2080>
    DocumentRoot /var/www/webdav
    DavLockDB /tmp/webdav.lock
    Alias /webdav /var/www/webdav

    <Directory /var/www/webdav>
        Dav On

        Options Indexes FollowSymLinks
        AllowOverride None

        AuthType Basic
        AuthName "WebDAV Storage"
        AuthUserFile /etc/httpd/webdav.htpasswd
        Require valid-user
    </Directory>
</VirtualHost>
htpasswd -c /etc/httpd/webdav.htpasswd UserName

nginx

Proxy it.

... ... (listener and SSL config)

location /webdav/ {
    proxy_pass http://[::1]:2080;

    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto http;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    client_max_body_size 0;
}

Launch

chown -R http:http /var/www/webdav

systemctl enable --now httpd
systemctl reload nginx

Access

Addr: https://(hostname)/webdav
User: (username)
Pass: (password)