{"id":562486,"date":"2023-02-25T12:53:53","date_gmt":"2023-02-25T04:53:53","guid":{"rendered":"http:\/\/4563.org\/?p=562486"},"modified":"2023-02-25T12:53:53","modified_gmt":"2023-02-25T04:53:53","slug":"rclone%e6%90%ad%e5%bb%bawebdav%e6%9c%8d%e5%8a%a1systemd%e4%bf%9d%e6%b4%bbnginx%e5%8f%8d%e4%bb%a3cf%e5%8a%a0%e9%80%9f%e4%b8%80%e6%9d%a1%e9%be%99","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=562486","title":{"rendered":"Rclone\u642d\u5efaWebdav\u670d\u52a1+Systemd\u4fdd\u6d3b+Nginx\u53cd\u4ee3+CF\u52a0\u901f\u4e00\u6761\u9f99"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>sharp097<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-1 23:50:26\t<\/p>\n<h3>Rclone\u642d\u5efaWebdav\u670d\u52a1+Systemd\u4fdd\u6d3b+Nginx\u53cd\u4ee3+CF\u52a0\u901f\u4e00\u6761\u9f99<\/h3>\n<p>  \t\t\u5e9f\u8bdd\u5c11\u8bf4\u76f4\u63a5\u4e0a\u5b9e\u6218\uff1a<br \/>  \u9996\u5148\u662f\u90e8\u7f72 rclone \u4e8c\u8fdb\u5236\u548c\u751f\u6210\u5bc6\u7801\uff1a<\/p>\n<p>  # adduser webdav # su &#8211; webdav &amp;&amp; mkdir rclone &amp;&amp; cd rclone<br \/>  $ wget https:\/\/downloads.rclone.org\/v1.61.1\/rclone-v1.61.1-linux-amd64.zip<br \/>  $ unzip rclone-v1.61.1-linux-amd64.zip &amp;&amp; mv rclone-v1.61.1-linux-amd64\/rclone .\/ &amp;&amp; rm -rf rclone-v1.61.1-linux-amd64*<br \/>  $ exit<br \/>  # cd \/home\/webdav\/rclone &amp;&amp; apt-get install apache2-utils &amp;&amp; touch htpasswd &amp;&amp; htpasswd -B htpasswd webdav_user1<br \/>  # vim \/etc\/systemd\/system\/webdav.service<\/p>\n<p>  \u7136\u540e\u5c31\u662f\u914d\u7f6e systemd \u8fdb\u7a0b\u4fdd\u6d3b\uff0c\u5c06\u4e0b\u9762\u7684\u914d\u7f6e\u590d\u5236\u7c98\u8d34\u8fdb\u5165 vim \u7f16\u8f91\u5668\u4e2d\uff1a<\/p>\n<p>  Description=my webdav service<br \/>  After=network.target<\/p>\n<p>  User=webdav<br \/>  # Execute `systemctl daemon-reload` after ExecStart= is changed.<br \/>  ExecStart=\/home\/webdav\/rclone\/rclone serve webdav \/home\/webdav\/Myspaces &#8211;addr 127.0.0.1:5000 &#8211;htpasswd \/home\/webdav\/rclone\/htpasswd<\/p>\n<p>  WantedBy=multi-user.target<\/p>\n<p>  \u7136\u540e\u5c06\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u9a8c\u8bc1\u4e00\u4e0b\u670d\u52a1\u662f\u5426\u6b63\u5e38\u548c\u7aef\u53e3\u662f\u5426\u8d77\u6765\u4e86\uff1a<\/p>\n<p>  # systemctl daemon-reload &amp;&amp; systemctl start webdav &amp;&amp; systemctl status webdav<br \/>  # netstat -lnptu<\/p>\n<p>  \u518d\u7136\u540e\u5c31\u662f Nginx \u53cd\u4ee3\u4e86\uff0c\u4ee5\u4e0b\u914d\u7f6e\u7531\u519b\u54e5\u7684 lnmp.org \u65d7\u4e0b\u7684 lnmp vhost add \u547d\u4ee4\u751f\u6210\uff1a<\/p>\n<p>  server<br \/>  {<br \/>  listen 80;<br \/>  #listen [::]:80;<br \/>  server_name www.webdav.sharpgan.com webdav.sharpgan.com;<br \/>  index index.html index.htm index.php default.html default.htm default.php;<br \/>  #include rewrite\/none.conf;<br \/>  #error_page 404 \/404.html;<br \/>  # Deny access to PHP files in specific directory<br \/>  #location ~ \/(wp-content|uploads|wp-includes|images)\/.*.php$ {deny all;}<br \/>  include enable-php.conf;<br \/>  location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$<br \/>  {<br \/>  expires 30d;<br \/>  }<br \/>  location ~ .*.(js|css)?$<br \/>  {<br \/>  expires 12h;<br \/>  }<br \/>  location ~ \/.well-known {<br \/>  allow all;<br \/>  }<br \/>  location \/ {<br \/>  return 301 https:\/\/$host$request_uri;<br \/>  }<br \/>  access_log \/home\/wwwlogs\/www.webdav.sharpgan.com.log;<br \/>  }<br \/>  server<br \/>  {<br \/>  listen 443 ssl http2;<br \/>  #listen [::]:443 ssl http2;<br \/>  server_name www.webdav.sharpgan.com webdav.sharpgan.com;<br \/>  index index.html index.htm index.php default.html default.htm default.php;<br \/>  ssl_certificate \/usr\/local\/nginx\/ssl\/cer.pem;<br \/>  ssl_certificate_key \/usr\/local\/nginx\/ssl\/pri.key;<br \/>  ssl_session_timeout 5m;<br \/>  ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;<br \/>  ssl_prefer_server_ciphers on;<br \/>  ssl_ciphers &quot;TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5&quot;;<br \/>  ssl_session_cache builtin:1000 shared:SSL:10m;<br \/>  # openssl dhparam -out \/usr\/local\/nginx\/conf\/ssl\/dhparam.pem 2048<br \/>  ssl_dhparam \/usr\/local\/nginx\/conf\/ssl\/dhparam.pem;<br \/>  include rewrite\/none.conf;<br \/>  #error_page 404 \/404.html;<br \/>  # Deny access to PHP files in specific directory<br \/>  #location ~ \/(wp-content|uploads|wp-includes|images)\/.*.php$ {deny all;}<br \/>  error_page 405 = @app;<br \/>  location @app {<br \/>  proxy_pass http:\/\/127.0.0.1:5000;<br \/>  proxy_set_header X-Real-IP $remote_addr;<br \/>  proxy_set_header REMOTE-HOST $remote_addr;<br \/>  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>  proxy_set_header Host $http_host;<br \/>  proxy_redirect off;<br \/>  }<br \/>  location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$<br \/>  {<br \/>  expires 30d;<br \/>  }<br \/>  location ~ .*.(js|css)?$<br \/>  {<br \/>  expires 12h;<br \/>  }<br \/>  location ~ \/.well-known {<br \/>  allow all;<br \/>  }<br \/>  location \/ {<br \/>  proxy_pass http:\/\/127.0.0.1:5000;<br \/>  proxy_set_header X-Real-IP $remote_addr;<br \/>  proxy_set_header REMOTE-HOST $remote_addr;<br \/>  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>  proxy_set_header Host $http_host;<br \/>  proxy_redirect off;<br \/>  }<br \/>  access_log \/home\/wwwlogs\/www.webdav.sharpgan.com.log;<br \/>  error_log \/home\/wwwlogs\/error.webdav.sharpgan.com.log;<br \/>  }<\/p>\n<p>  \u4f60\u6700\u597d\u662f\u6267\u884c\u4e00\u4e0b\u519b\u54e5\u7684\u547d\u4ee4\u751f\u6210\u4e00\u4e0b\uff0c\u56e0\u4e3a\u524d\u8005\u4f1a\u5e2e\u4f60\u751f\u6210\/usr\/local\/nginx\/conf\/ssl\/dhparam.pem \u8fd9\u4e2a\u4e1c\u897f\uff0c\u4e0d\u592a\u61c2\uff0c\u597d\u50cf\u8ddf\u5b89\u5168\u6709\u5173\u3002<\/p>\n<p>  \u4e0a\u9762\u7684\u8bc1\u4e66\u6211\u7528\u7684\u662f cf \u7684 15 \u5e74\u514d\u8d39\u7684\u901a\u914d\u7b26\u8bc1\u4e66\uff0c\u519b\u54e5\u7684\u547d\u4ee4\u4f1a\u63d0\u9192\u4f60\u8f93\u5165\u8bc1\u4e66\u7684\u8def\u5f84\uff0c\u7167\u7740\u63d0\u793a\u5f04\u5c31\u884c\uff0c\u5b9e\u5728\u4e0d\u592a\u660e\u767d\u7684\u53c2\u8003\u4e00\u4e0b\u4e0b\u9762\u8fd9\u7bc7\u519b\u54e5\u7684\u535a\u5ba2\uff1a<br \/>  https:\/\/www.vpser.net\/build\/lnmp-wordpress-howto-3.html<\/p>\n<p>  \u6211\u6765\u8bf4\u4e00\u4e0b\u8fd9\u91cc\u9762\u6700\u6838\u5fc3\u7684\u90e8\u5206\uff1a<\/p>\n<p>  location \/ {<br \/>  proxy_pass http:\/\/127.0.0.1:5000;<br \/>  proxy_set_header X-Real-IP $remote_addr;<br \/>  proxy_set_header REMOTE-HOST $remote_addr;<br \/>  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>  proxy_set_header Host $http_host;<br \/>  proxy_redirect off;<br \/>  }<\/p>\n<p>  \u8fd9\u6bb5 Nginx \u7684\u914d\u7f6e\u662f\u6574\u4e2a\u53cd\u4ee3\u7684\u6838\u5fc3\u914d\u7f6e\u3002<br \/>  \u518d\u7136\u540e\u5c31\u662f\u4e0b\u9762\u8fd9\u6bb5\uff1a<\/p>\n<p>  error_page 405 = @app;<br \/>  location @app {<br \/>  proxy_pass http:\/\/127.0.0.1:5000;<br \/>  proxy_set_header X-Real-IP $remote_addr;<br \/>  proxy_set_header REMOTE-HOST $remote_addr;<br \/>  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>  proxy_set_header Host $http_host;<br \/>  proxy_redirect off;<br \/>  }<\/p>\n<p>  \u5982\u679c\u5c11\u4e86\u8fd9\u4e00\u6bb5\u90e8\u5206\u5e94\u7528\u7528 POST \u65b9\u6cd5\u4e0a\u4f20 js \u548c png \u7b49\u9759\u6001\u6587\u4ef6\u65f6 Nginx \u90a3\u8fb9\u4f1a\u62a5 method not allowed: 405 \u9519\u8bef\u3002<\/p>\n<p>  \u8fd9\u4e00\u6bb5\u914d\u7f6e\u662f\u6211\u81ea\u5df1\u6478\u722c\u6eda\u6253\u53c2\u8003\u4e86\u65e0\u6570\u535a\u5ba2\u8bd5\u9a8c\u51fa\u6765\u7684\uff0c\u8c8c\u4f3c\u5168\u7f51\u72ec\u4e00\u65e0\u4e8c\uff0c\u7f51\u4e0a\u4e3b\u6d41\u7684\u505a\u6cd5\u662f\u52a0\u4e00\u6bb5\u201cerror_page 405 =200 http:\/\/$host$request_uri;\u201d\u8fd9\u6837\u7684\u914d\u7f6e\uff0c\u4f46\u662f\u8fd9\u4e2a\u914d\u7f6e\u52a0\u4e86\u4e4b\u540e\u6211\u5e38\u7528\u7684\u4e00\u4e2a\u53ef\u4ee5\u540c\u6b65 webdav \u7684\u540c\u6b65\u8f6f\u4ef6 goodsync \u4f1a\u62a5\u5947\u602a\u7684\u9519\u8bef\uff0c\u6240\u4ee5\u4e5f\u5c31\u662f\u8bf4\u4e3b\u6d41\u7684\u505a\u6cd5\u6ca1\u5375\u7528\u3002<\/p>\n<p>  \u6700\u540e\u5c31\u662f\u914d\u7f6e CF \u7684 DNS \u89e3\u6790\u4e86\uff0c\u76f8\u4fe1 mjj \u4eec\u90fd\u4f1a\u914d\u7f6e\u6211\u5c31\u4e0d\u8d58\u8ff0\u4e86\uff0c\u8fd9\u91cc\u8bf4\u4e00\u4e2a\u5c0f\u70b9\uff0c\u5c31\u662f www.webdav.sharpgan.com \u8fd9\u6837\u7684 DNS \u89e3\u6790\u914d\u7f6e\u662f\u4e0d\u53d7 CF \u7684\u901a\u914d\u7b26\u8bc1\u4e66\u6240\u652f\u6301\u7684\uff0c\u56e0\u4e3a CF \u53ea\u652f\u6301\u57df\u540d\u5f80\u4e0b\u4e00\u7ea7\u7684\u5b50\u57df\u540d\uff0c\u8fd9\u91cc\u628a www. \u53bb\u6389\u5c31\u884c\u4e86\u3002<\/p>\n<p>  \u6700\u540e\u5c55\u793a\u4e00\u4e0b\u5b9e\u6218\u6548\u679c\uff0c\u4ee5\u6211\u5e38\u7528\u7684\u652f\u6301 webdav \u540c\u6b65\u7684\u540c\u6b65\u8f6f\u4ef6 goodsync \u4e3a\u4f8b\uff1a<br \/>  \u559c\u6b22\u4ee3\u7801\u9ad8\u4eae\u7684\u548c\u9700\u8981\u770b\u5b9e\u6218\u6548\u679c\u7684mjj\u79fb\u6b65\u6211\u7684\u535a\u5ba2\u54c8\uff1a<br \/>  https:\/\/sharpgan.com\/rclone-webdav-service-with-systemd-and-nginx-and-cloudflare\/  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>kezhao<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-1 23:51:24\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u8fd9\u4e2a\u6709\u5565\u7528\uff1f\u4e00\u822c\u7528\u4e0d\u5230\u628a\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u96e8\u58a8<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-1 23:51:48\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6536\u85cf=\u4e0d\u770b:lol\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u9676\u6e0a\u660e<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-1 23:54:03\t<\/p>\n<h3><\/h3>\n<p>  \t\talist\u5c31\u6709webdav\u529f\u80fd\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>sharp097<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-1 23:55:28\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u9676\u6e0a\u660e \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-1 23:54<br \/>  alist\u5c31\u6709webdav\u529f\u80fd<\/p>\n<p> \u4e0d\u592a\u559c\u6b22\u5e26web\u754c\u9762\u7684webdav,\u66f4\u559c\u6b22\u7eaf\u547d\u4ee4\u884c\u7684\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u4e09\u4e2b\u7684<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-1 23:56:01\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6536\u85cf\u5148\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>sharp097<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-1 23:56:48\t<\/p>\n<h3><\/h3>\n<p>  \t\tkezhao \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-1 23:51<br \/>  \u8fd9\u4e2a\u6709\u5565\u7528\uff1f\u4e00\u822c\u7528\u4e0d\u5230\u628a<\/p>\n<p> \u9759\u8bfb\u5929\u4e0b\u540c\u6b65PDF\uff0cenpass\u540c\u6b65\u5bc6\u7801\uff0csinglefile\u540c\u6b65\u7f51\u9875\u90fd\u53ef\u4ee5\u7528\u5230webdav\u5462\uff0c\u5b9e\u5728\u4e0d\u60f3\u7ed9\u575a\u679c\u4e91\u7838\u94b1\u4e86\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>letzvps<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-2 01:00:52\t<\/p>\n<h3><\/h3>\n<p>  \t\tsharp097 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-1 23:55<br \/>  \u4e0d\u592a\u559c\u6b22\u5e26web\u754c\u9762\u7684webdav,\u66f4\u559c\u6b22\u7eaf\u547d\u4ee4\u884c\u7684<\/p>\n<p> \u90a3webdav\u4e3a\u4ec0\u4e48\u53ebweb\uff1f \u7adf\u7136\u8fd8\u53d1\u660e\u4e00\u4e2awebdav service\uff1f \u54ea\u4e2a\u534a\u540a\u5b50\u53d1\u660e\u7684\uff1f\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>AceSheep<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-2 01:28:47\t<\/p>\n<h3><\/h3>\n<p>  \t\tnginx \u5c31\u53ef\u4ee5\u5f00 webdav \u529f\u80fd, \u53cd\u4ee3\u591a\u6b64\u4e00\u4e3e\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Typeboom<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-2-2 01:43:51\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u867d\u7136\u4f46\u662f\uff0c\u5982\u679c\u8fd9\u6837\u7528Cloudflare\uff0c\u6d41\u91cf\u5927\u4e86\u4e4b\u540e\uff0c\u5a92\u4f53\u6587\u4ef6\u4f1a\u5168\u90e8\u88ab\u66ff\u6362\u6210\u4e09\u79d2\u6559\u80b2\u7247\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>sharp097 \u5927\u4f6c\u6709\u8bdd\u8bf4 : &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/562486"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=562486"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/562486\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=562486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=562486"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=562486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}