Mount WebDav on linux

本文最后更新于:2024年8月9日 晚上

Install davfs2

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

Install davfs2 and manully mount
1
2
3
4
5
6
7
8
9
10
11
# 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
1
2
3
4
5
6
7
8
9
10
# 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


Mount WebDav on linux
https://git.msft.vip/2023/09/18-Mount-WebDav-on-linux/
作者
Jas0n0ss
发布于
2023年9月19日
更新于
2024年8月9日
许可协议