novip 发表于 2024-12-20 14:47:22

Joplin最简单部署方法,基于Nginx搭建WebDAV服务的详细过程

<i class="pstatus"> 本帖最后由 novip 于 2024-12-20 18:22 编辑 </i><br />
<br />
在搭建 Joplin 笔记服务的时候,发现了可以通过 WebDAV 服务来实现云笔记的功能,所以本篇就来介绍一下,怎么快速搭建 WebDAV 服务。<br />
<br />
WebDAV (Web-based Distributed Authoring and Versioning) 一种基于 HTTP 1.1协议的通信协议。它扩展了HTTP 1.1,在GET、POST、HEAD等几个HTTP标准方法以外添加了一些新的方法,使应用程序可对(https://baike.baidu.com/item/Web Server/9306055?fromModule=lemma_inlink)直接读写,并支持写文件锁定(Locking)及解锁(Unlock),还可以支持文件的版本控制。<br />
<br />
从我的角度,简单地理解为,类似于FTP服务,提供网络文件交互服务。可以使用用户名和密码来控制访问,通过特定的客户端,可以直接存储、下载、编辑文件。<br />
<br />
<br />
搭建与配置<br />
这里我是用宝塔面板来实现整个过程的,知晓原理后,也可以用其他类似的手段实现。<br />
<br />
官方安装示例 (Module ngx_http_dav_module (nginx.org))<br />
<br />
<br />
重新安装 Nginx<br />
在宝塔面板,Nginx 安装中选择 编译安装,并点击 添加自定义模块。<br />
<img id="aimg_dM9b3" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://ice.frostsky.com/2024/12/20/33f9af56aaa92c3fcf92fdc1df58d2ea.png" onmouseover="img_onmouseoverfunc(this)" onload="thumbImg(this)" border="0" alt="" /><br />
<br />
添加自定义模块<br /><div class="blockcode"><div id="code_km9"><ol><li>模块名称:http_dav_module<br /><li>模块描述:webdev<br /><li>模块参数:--with-http_dav_module --add-module=/root/nginx-dav-ext-module<br /><li>前置脚本:git clone https://github.com/arut/nginx-dav-ext-module.git /root/nginx-dav-ext-module<br /><li></ol></div><em onclick="copycode($('code_km9'));">复制代码</em></div><br />
<br />
<img id="aimg_nPO16" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://ice.frostsky.com/2024/12/20/6967e1b9f1144569e0b5f9adf229d0d8.png" onmouseover="img_onmouseoverfunc(this)" onload="thumbImg(this)" border="0" alt="" /><br />
<br />
nginx-dav-ext-module 介绍<br />
<br />
标准的 ngx_http_dav_module 提供了部分WebDAV实现,仅支持GET、HEAD、PUT、DELETE、MKCOL、COPY和MOVE方法。要在 Nginx 中获得完整的 WebDAV 支持,您需要启用 ngx_http_dav_module 以及此模块(nginx-dav-ext-module)以补充缺少的方法,如:PROPFIND,OPTIONS,LOCK,UNLOCK。<br />
<br />
<br />
部署 WebDAV 网站服务<br />
添加一个新网站<br />
<br />
<img id="aimg_kqQ99" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://ice.frostsky.com/2024/12/20/33229e7c82c24e974824fe0cfbf33f74.png" onmouseover="img_onmouseoverfunc(this)" onload="thumbImg(this)" border="0" alt="" /><br />
<br />
最后前往网站设置选择配置文件,在最后面 } 符号之前粘贴以下设置代码:<br /><div class="blockcode"><div id="code_Re8"><ol><li>location / {<br /><li>root /www/wwwroot/xx.xxx.cn; # WebDAV目录路径(请自行修改为搭建目录)<br /><li>client_max_body_size 102400M; # 大文件支持参数<br /><li>charset utf-8; # 编码参数(不设定可能导致中文乱码)<br /><li>autoindex on;<br /><li>dav_methods PUT DELETE MKCOL COPY MOVE;<br /><li># 需要 nginx-dav-ext-module 才有下面的选项<br /><li>dav_ext_methods PROPFIND OPTIONS LOCK UNLOCK;<br /><li>create_full_put_pathon;<br /><li>}</ol></div><em onclick="copycode($('code_Re8'));">复制代码</em></div><br />
<br />
<br />
<br />
在 网站目录 加入密码保护即可<br />
<br />
<img id="aimg_Fb4Fc" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://ice.frostsky.com/2024/12/20/77b7f661acc37c663a5e502a29250ef4.png" onmouseover="img_onmouseoverfunc(this)" onload="thumbImg(this)" border="0" alt="" /><br />
<br />
应用<br />
接下来,就可以在需要 WebDAV 服务的地方使用了。<br />
<br />
比如:Joplin<br />
<img id="aimg_CZ7Z7" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://ice.frostsky.com/2024/12/20/9223401e49022d564797ce7c8af47751.png" onmouseover="img_onmouseoverfunc(this)" onload="thumbImg(this)" border="0" alt="" /><br />
<br />
WebDAV URL:就是你访问那个 WebDAV 网站的地址<br />
<br />
用户名和密码:就是刚才设置的密码访问

yinguo520 发表于 2024-12-20 14:50:58

docker装。这个保存一下

jarmoku 发表于 2024-12-20 16:25:14

建议用caddy搭建,nginx的wevdav这垃圾模块我就不说了,我前几天刚发现了一个BUG发现好几年前就有人提交了没人管。当然了你要是自己编译我不说什么<img id="aimg_B8Lh9" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif" onmouseover="img_onmouseoverfunc(this)" onload="thumbImg(this)" border="0" alt="" />

jarmoku 发表于 2024-12-20 16:26:25

这个BUG就是,不显示隐藏文件(.开头的文件名)。<img id="aimg_aCITo" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif" onmouseover="img_onmouseoverfunc(this)" onload="thumbImg(this)" border="0" alt="" />

netAlchemist 发表于 2024-12-20 16:42:24

我也折腾过 应该还是自己搭建joplin server同步最靠谱

novip 发表于 2024-12-20 18:23:20

<div class="quote"><blockquote><font size="2"><a href="https://hostloc.com/forum.php?mod=redirect&goto=findpost&pid=16136812&ptid=1376172" target="_blank"><font color="#999999">jarmoku 发表于 2024-12-20 16:25</font></a></font><br />
建议用caddy搭建,nginx的wevdav这垃圾模块我就不说了,我前几天刚发现了一个BUG发现好几年前就有人提交了 ...</blockquote></div><br />
caddy难不,主要就是觉得wevdav比较简单!

jarmoku 发表于 2024-12-20 16:25:00

<div class="quote"><blockquote><font size="2"><a href="https://hostloc.com/forum.php?mod=redirect&goto=findpost&pid=16137159&ptid=1376172" target="_blank"><font color="#999999">novip 发表于 2024-12-20 18:23</font></a></font><br />
caddy难不,主要就是觉得wevdav比较简单!</blockquote></div><br />
我给你一个配置吧,caddy的教材我是真看不懂<img id="aimg_q69QD" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif" onmouseover="img_onmouseoverfunc(this)" onload="thumbImg(this)" border="0" alt="" />

jarmoku 发表于 2024-12-20 20:18:43

<i class="pstatus"> 本帖最后由 jarmoku 于 2024-12-20 20:25 编辑 </i><br />
<br />
https://pastebin.com/KtNaT8Ha<br />
你再问问chatgpt应该都能理解了<img id="aimg_tbLBZ" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif" onmouseover="img_onmouseoverfunc(this)" onload="thumbImg(this)" border="0" alt="" />

chinni 发表于 2024-12-20 18:23:00

为了 webdav 弄个joplin 可还行 flydav 了解下 直接一个二进制。一个配置文件就可以多用户了

novipqxwo 发表于 2024-12-20 20:21:31

<div class="quote"><blockquote><font size="2"><a href="https://hostloc.com/forum.php?mod=redirect&goto=findpost&pid=16137329&ptid=1376172" target="_blank"><font color="#999999">jarmoku 发表于 2024-12-20 20:21</font></a></font><br />
https://pastebin.com/KtNaT8Ha<br />
你再问问chatgpt应该都能理解了</blockquote></div><br />
多谢有么有思维导图加笔记的开源项目
页: [1] 2
查看完整版本: Joplin最简单部署方法,基于Nginx搭建WebDAV服务的详细过程