广告

本站里的文章大部分经过自行整理与测试

2017年1月20日星期五

Ubuntu - Nginx - WebDAV 服务

1. 准备

$ su

$ mkdir /var/webdav
$ chmod 777 /var/webdav

$ printf "USER:$(openssl passwd -crypt PASSWORD)\n" >> /var/.htpasswd

$ printf "USER:Y/RasqlW9biwY\n" >> /var/.htpasswd

2. 安装

$ apt install nginx nginx-extras

3. 设置

$ gedit /etc/nginx/sites-available/default

server { 
       location /webdav {
root /var;
autoindex on;

dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;

create_full_put_path on;
client_max_body_size 1G;

dav_access user:rw group:r all:r;

auth_basic "Authorized Users Only";
auth_basic_user_file /var/.htpasswd;
}
}

4. 重启

$ nginx -t
$ systemctl restart nginx

5. 防火壁

$ ufw allow 80/tcp
$ ufw allow 443/tcp

6. 客户端

$ apt install davfs2
$ mkdir /media/dav
$ mount -t davfs http://127.0.0.1/webdav /media/dav

$ apt install cadaver
$ cadaver http://127.0.0.1/webdav

BitKinex
http://www.bitkinex.com/download

WinSCP
https://winscp.net/eng/download.php

没有评论:

发表评论