{"id":710,"date":"2023-11-30T22:37:42","date_gmt":"2023-11-30T14:37:42","guid":{"rendered":"http:\/\/www.huerpu.cc:7000\/?p=710"},"modified":"2023-12-01T12:03:12","modified_gmt":"2023-12-01T04:03:12","slug":"ubuntu22-04%e9%80%9a%e8%bf%87nginx%e9%85%8d%e7%bd%aewebdav","status":"publish","type":"post","link":"http:\/\/www.huerpu.cc:7000\/?p=710","title":{"rendered":"Ubuntu22.04\u901a\u8fc7Nginx\u914d\u7f6ewebdav"},"content":{"rendered":"<h3>Ubuntu22.04\u901a\u8fc7Nginx\u914d\u7f6ewebdav<\/h3>\n<pre><code class=\"language-shell\">#\u5207\u6362\u5230root\u7528\u6237\nsudo su -\n\n#\u5b89\u88c5\u4f9d\u8d56\napt install libxslt-dev libpcre3-dev zlib1g-dev libssl-dev libxml2-dev libxslt1-dev  libgd-dev google-perftools libgoogle-perftools-dev libperl-dev libgeoip-dev\n\n#\u5982\u679c\u76f4\u63a5apt install Nginx \u53ea\u4f1a\u5b89\u88c5nginx\u6838\u5fc3\uff0c\u4f46\u4e0d\u4f1a\u5b89\u88c5nginx-dav-ext-module\u6a21\u5757\uff0c\u4e5f\u5c31\u65e0\u6cd5\u4f7f\u7528webdav\u7684\u5168\u90e8\u529f\u80fd\u4e86\uff0c\u914d\u7f6e\u9879\u662fdav_ext_methods PROPFIND OPTIONS LOCK UNLOCK;\u8fd9\u4e00\u6761\u3002\n\n#\u4e0b\u8f7dnginx-1.18.0.tar.gz\u548cnginx-dav-ext-module-master.zip\u5e76\u89e3\u538b\u5230\u684c\u9762\nroot@hep:\/home\/jason\/Desktop# ls\ninstation.txt  nginx-1.18.0  nginx-1.18.0.tar.gz  nginx-dav-ext-module  nginx-dav-ext-module-master.zip\nroot@hep:\/home\/jason\/Desktop#\n\n#cd\u5230Nginx\u6839\u76ee\u5f55\ncd nginx-1.18.0\n\n#\u914d\u7f6e\n.\/configure --with-http_dav_module --add-module=\/home\/jason\/Desktop\/nginx-dav-ext-module\/  --prefix=\/usr\/local\/nginx\n#\u6700\u540e\u4f1a\u51fa\u73b0\u4e0b\u9762\u5185\u5bb9\uff0c\u5305\u62ec\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\uff0cnginx\u4f4d\u7f6e\n  Configuration summary\n  + using system PCRE library\n  + OpenSSL library is not used\n  + using system zlib library0\n\n  nginx path prefix: &quot;\/usr\/local\/nginx&quot;\n  nginx binary file: &quot;\/usr\/local\/nginx\/sbin\/nginx&quot;\n  nginx modules path: &quot;\/usr\/local\/nginx\/modules&quot;\n  nginx configuration prefix: &quot;\/usr\/local\/nginx\/conf&quot;\n  nginx configuration file: &quot;\/usr\/local\/nginx\/conf\/nginx.conf&quot;\n  nginx pid file: &quot;\/usr\/local\/nginx\/logs\/nginx.pid&quot;\n  nginx error log file: &quot;\/usr\/local\/nginx\/logs\/error.log&quot;\n  nginx http access log file: &quot;\/usr\/local\/nginx\/logs\/access.log&quot;\n  nginx http client request body temporary files: &quot;client_body_temp&quot;\n  nginx http proxy temporary files: &quot;proxy_temp&quot;\n  nginx http fastcgi temporary files: &quot;fastcgi_temp&quot;\n  nginx http uwsgi temporary files: &quot;uwsgi_temp&quot;\n  nginx http scgi temporary files: &quot;scgi_temp&quot;\n#\u7f16\u8bd1\u5e76\u5b89\u88c5 \nmake &amp;&amp; make install\n\n#\u6d4b\u8bd5\u4e00\u4e0bNginx\u662f\u5426\u6b63\u786e\uff0c\u4f1a\u663e\u793asuccessful\nsudo \/usr\/local\/nginx\/sbin\/nginx -t\n\n#\u8fd0\u884cNginx\u547d\u4ee4\nsudo \/usr\/local\/nginx\/sbin\/nginx\n\n#\u7ed3\u675f\u540e\u53f0\u7684Nginx\nkillall nginx\n\n#\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u7ed9webdav\nmkdir -p \/var\/www\/webdav\n#\u628a\u6743\u9650\u7ed9\u5230jason\u7528\u6237\nchown jason:jason \/var\/www\/webdav\n\n#\u7f16\u8f91Nginx\u914d\u7f6e\u6587\u4ef6\nvim \/usr\/local\/nginx\/conf\/nginx.conf\n#\u589e\u52a0\u4e0b\u9762\u5185\u5bb9\nlocation \/webdav {\n           alias \/var\/www\/webdav;\n           autoindex on;\n           dav_methods PUT DELETE MKCOL COPY MOVE;\n           dav_ext_methods PROPFIND OPTIONS LOCK UNLOCK;\n           create_full_put_path  on;\n           dav_access  user:rw  group:rw  all:r;\n           auth_basic &quot;webdav&quot;;\n           auth_basic_user_file \/etc\/nginx\/.htpasswd;\n}\n\n#\u6211\u8fd8\u628a\u7aef\u53e3\u6539\u6210\u4e8688\nlisten       88;\n\n#\u5b89\u88c5apache2-utils\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528htpasswd\u547d\u4ee4\u4e86\napt install apache2-utils -y\n\n#\u521b\u5efa.htpasswd\u8d26\u53f7\u5bc6\u7801\u6587\u4ef6\nmkdir -p \/etc\/nginx\nhtpasswd -c \/etc\/nginx\/.htpasswd myUserName\n\n#\u8fd0\u884cNginx\u547d\u4ee4\nsudo \/usr\/local\/nginx\/sbin\/nginx\n\n#\u5f00\u653e88\u7aef\u53e3\nufw allow 88\nufw enable\n\n#\u7136\u540e\u5c31\u901a\u8fc7\u670d\u52a1IP\u548c\u7aef\u53e3\u53f7\u8fdb\u884c\u8bbf\u95ee\u4e86\nhttp:\/\/192.168.31.194:88\/webdav\/\n\n#\u521b\u5efaservice\u6587\u4ef6\nvim \/lib\/systemd\/system\/nginx.service\n#\u5185\u5bb9\u5982\u4e0b\uff1a\n[Unit]\nDescription=nginx server\nAfter=network.target remote-fs.target nss-lookup.target\n\n[Service]\nType=forking\nExecStart=\/usr\/local\/nginx\/sbin\/nginx -c \/usr\/local\/nginx\/conf\/nginx.conf\nExecReload=\/usr\/local\/nginx\/sbin\/nginx -s reload\nExecStop=\/usr\/local\/nginx\/sbin\/nginx -s stop\n[Install]\nWantedBy=multi-user.target\n\n#\u7ed9nginx.service\u52a0\u53ef\u6267\u884c\u6743\u9650\nchmod +x \/lib\/systemd\/system\/nginx.service\n\n#\u91cd\u65b0\u52a0\u8f7dsystemctl\nsystemctl daemon-reload\n\n#\u542f\u52a8\nsystemctl start nginx\n\n#\u505c\u6b62\nsystemctl stop nginx\n\n#\u91cd\u65b0\u52a0\u8f7d\nsystemctl reload nginx\n\n#\u663e\u793anginx\u670d\u52a1\u7684\u72b6\u6001\nsystemctl status nginx\n\n#\u5728\u5f00\u673a\u65f6\u542f\u7528nginx\u670d\u52a1\nsystemctl enable nginx\n\n#\u5728\u5f00\u673a\u65f6\u7981\u7528nginx\u670d\u52a1\nsystemctl disable nginx<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu22.04\u901a\u8fc7Nginx\u914d\u7f6ewebdav #\u5207\u6362\u5230root\u7528\u6237 sudo su &#8211; #\u5b89\u88c5\u4f9d\u8d56 a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-710","post","type-post","status-publish","format-standard","hentry","category-ubuntu"],"_links":{"self":[{"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=\/wp\/v2\/posts\/710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=710"}],"version-history":[{"count":2,"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=\/wp\/v2\/posts\/710\/revisions"}],"predecessor-version":[{"id":712,"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=\/wp\/v2\/posts\/710\/revisions\/712"}],"wp:attachment":[{"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=710"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}