webdav挂载到本地

2017/04/15 linux

webdav挂载到本地

centos 安装 davfs2

You have to enable the EPEL repo in order to install that package:

yum -y install epel-release
yum -y install davfs2

After you’re done installing the required packages please disable the epel repo since you are on a cPanel server and this additional repo, at some point might break some package dependencies when cPanel/WHM nightly update is running.

To disable the EPEL repo you can edit /etc/yum.repos.d/epel.repo file and replace enabled=1 with enabled=0

挂载

mkdir -p /mnt/webdav
mount -t davfs http://127.0.0.1/dav /mnt/webdav


会提示输入系统帐号密码

Please enter the username to authenticate with server http://127.0.0.1/dav or hit enter for none. Username: root Please enter the password to authenticate user root with server http://127.0.0.1/dav or hit enter for none. Password:

开机启动

1.修改配置文件

sed -i 's/# use_locks       1/use_locks       0/g' /etc/davfs2/davfs2.conf

2.将发布地址及帐号密码写入配置文件

echo "http://127.0.0.1/dav root 123456" >> /etc/davfs2/secrets

3.开机启动

echo "mount.davfs  http://127.0.0.1/dav /mnt/webdav/" >> /etc/rc.local

Search

    Table of Contents