使用宝塔搭建WebDav

技术
695 0

场景

手里有一部分书的音频素材,利用碎片化时间收听。原本计划是自己写个小工具,朋友推荐EverPlay这个App后爱不释手。为了减少手机空间的占用,遂搭配自建WebDav来使用。

步骤

1.安装宝塔,选择安装nginx【极速,编译均可】

2.查看nginx是否支持dav 。执行nginx -V 查看是否存在 nginx-dav-ext-module
默认是存在的,如下

[root@VM-12-10-centos ~]# nginx -V
nginx version: nginx/1.21.0
built by gcc 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC) 
built with OpenSSL 1.1.1k  25 Mar 2021
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/www/server/nginx --add-module=srclib/ngx_devel_kit --add-module=srclib/lua_nginx_module --add-module=srclib/ngx_cache_purge --add-module=srclib/nginx-sticky-module --with-openssl=srclib/openssl --with-pcre=srclib/pcre-8.43 --with-http_v2_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E --with-cc-opt=-Wno-error --with-http_dav_module --add-module=srclib/nginx-dav-ext-module

3.新建静态站点后,修改配置文件【网站列表--该站点--设置--配置文件】,新增

    location / {
        root /www/wwwroot/gt520.com;#这里写你webdav的路径
        client_max_body_size 102400M;#大文件支持
        autoindex on;
        dav_methods PUT DELETE MKCOL COPY MOVE;
        # 需要 nginx-dav-ext-module 才有下面的选项
        dav_ext_methods PROPFIND OPTIONS LOCK UNLOCK;
        create_full_put_path  on;
    }

4.设置此站点webdav模式的账户密码【网站列表--该站点--设置--网站目录--密码访问】

5.齐活,happy吧

最后更新 2022-12-09
评论 ( 0 )
OωO
隐私评论