Linux CentOS7 掛載使用 NAS 上的 WebDAV
1、系統環境
系統: centos 7.2, nas安裝的webdav
2、軟件說明
下載地址:
1、下載davfs2
下載: wget https://download.savannah.gnu.org/releases/davfs2/davfs2-1.5.0.tar.gz
web站點: https://download.savannah.gnu.org/releases
# ps: 如果是1.5.4的需要 gcc 5.4版本以上
2、下載neon組件
wget https://web.archive.org/web/20170321153423if_/http://webdav.org/neon/neon-0.30.2.tar.gz
web站點:https://web.archive.org/web/20170923042221/http://webdav.org:80/neon/
# ps: 安裝一點要加上 --with-ssl 開啓功能
如果是centos 6可以直接 下載rpm包或yum安裝
rpm包下載地址: http://pan.baidu.com/s/1bniqE1h
3、安裝
yum -y install libxml2 libxml2-devel gcc gcc-c++
cd /mnt/
tar xf neon-0.30.2.tar.gz
./configure --with-ssl
make && make install
tar xf davfs2-1.5.0.tar.gz
./configure
make && make install
打印日誌 注意安裝路徑,後續的自動掛載需要
4、掛載
1、手動掛載
2、自動掛載
第一步:使用sed命令修改系統設置
sed -i 's/# use_locks 1/use_locks 0/g' /usr/local/etc/davfs2/davfs2.conf
第二步:將WebDAV發佈地址以及賬號密碼寫入配置文件
echo "1.1.1.1 賬戶 密碼" > /usr/local/etc/davfs2/secrets
第三步:加入系統自動啓動
echo "mount.davfs 1.1.1.1 /掛載地址" >> /etc/rc.local
最後reboot系統測試一下吧。
參考地址:
1、https://www.zhangfangzhou.cn/tag/webdav
2、https://www.xiaoz.me/archives/8429
3、http://www.zntec.cn/archives/linux-davfs2.html