Mount WebDav on linux

Linux

Install davfs2

davfs2 is a Linux tool for connecting to WebDAV shares and mount as local disks

Install davfs2 and manully mount
# for rocky/rhel9
root@srv:~# yum-config-manager --add-repo http://www.city-fan.org/ftp/contrib/yum-repo/rhel9/x86_64/
root@srv:~# yum search davfs2
Last metadata expiration check: 0:51:06 ago on Mon 18 Sep 2023 11:50:44 PM CST.
========================================================================== Name Exactly Matched: davfs2 ==========================================================================
davfs2.x86_64 : A filesystem driver for WebDAV
root@srv:~# yum install davfs2.x86_64 -yq
# will need user and password when mount webdav
root@srv:~# mkdir /aliyun/ && mount.davfs http://alist.srv/dav/ /aliyun
root@srv:~# df -Th | grep aliyun
http://alist.srv/dav/  fuse      1.3T  763G  509G  61% /aliyun
Auto mount webdav when system system startup
# uncomment and edit use_locks to 0
root@srv:~# grep use_lock /etc/davfs2/davfs2.conf
use_locks       0
# append "https://pan.cloud.com/dav user password"
root@srv:~# vim /etc/davfs2/secrets
root@srv:~# tail -n1 /etc/davfs2/secrets
http://alist.srv/dav admin westlife
root@srv:~# echo "mount.davfs http://alist.srv/dav /aliyun/" >>/etc/rc.d/rc.local
root@srv:~# chmod +x /etc/rc.d/rc.local && tail /etc/rc.d/rc.local | grep dav
mount.davfs http://alist.srv/dav/ /aliyun/

When mount aliyundrive to local linux server, all media content should be able add to Plex , then we can enjoy the Plex +aliyun+ webdav.

image-20230919005809861