{"id":527,"date":"2025-07-27T09:56:01","date_gmt":"2025-07-27T01:56:01","guid":{"rendered":"https:\/\/www.vcidc.net\/blog\/?p=527"},"modified":"2025-07-27T09:56:01","modified_gmt":"2025-07-27T01:56:01","slug":"%e6%9c%80%e4%bd%b3web%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%bd%af%e4%bb%b6%e6%8e%a8%e8%8d%90%e5%88%97%e8%a1%a8","status":"publish","type":"post","link":"https:\/\/www.vcidc.net\/blog\/527.html","title":{"rendered":"\u6700\u4f73Web\u670d\u52a1\u5668\u8f6f\u4ef6\u63a8\u8350\u5217\u8868"},"content":{"rendered":"<p><h3>\u63a8\u8350Web\u670d\u52a1\u5668\u8f6f\u4ef6\u6392\u884c\u699c<\/h3>\n<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.vcidc.net\/blog\/wp-content\/uploads\/2025\/07\/xV72pO.jpg\" alt=\"\u6700\u4f73Web\u670d\u52a1\u5668\u8f6f\u4ef6\u63a8\u8350\u5217\u8868\" title=\"\u6700\u4f73Web\u670d\u52a1\u5668\u8f6f\u4ef6\u63a8\u8350\u5217\u8868\"><\/p>\n<p><p>\u5728\u4f17\u591aWeb\u670d\u52a1\u5668\u8f6f\u4ef6\u4e2d\uff0c\u4ee5\u4e0b\u51e0\u79cd\u56e0\u5176\u7a33\u5b9a\u6027\u548c\u6613\u7528\u6027\u800c\u53d7\u5230\u5e7f\u6cdb\u63a8\u8350\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><p><strong>Apache<\/strong>\uff1aApache HTTP Server\u662f\u4e16\u754c\u4e0a\u6700\u6d41\u884c\u7684Web\u670d\u52a1\u5668\u8f6f\u4ef6\u4e4b\u4e00\uff0c\u5177\u6709\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u652f\u6301\u5e7f\u6cdb\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4e14\u793e\u533a\u652f\u6301\u4e30\u5bcc\u3002<\/li>\n<\/p>\n<li>\n<p><p><strong>Nginx<\/strong>\uff1aNginx\u4ee5\u5176\u9ad8\u6027\u80fd\u548c\u4f4e\u8d44\u6e90\u6d88\u8017\u8457\u79f0\uff0c\u7279\u522b\u9002\u5408\u5904\u7406\u9ad8\u5e76\u53d1\u8bf7\u6c42\uff0c\u88ab\u8bb8\u591a\u5927\u578b\u7f51\u7ad9\u6240\u91c7\u7528\u3002<\/li>\n<\/p>\n<li>\n<p><p><strong>IIS<\/strong>\uff1aInternet Information Services\uff08IIS\uff09\u662f\u5fae\u8f6f\u516c\u53f8\u5f00\u53d1\u7684Web\u670d\u52a1\u5668\u8f6f\u4ef6\uff0c\u4e3b\u8981\u8fd0\u884c\u5728Windows\u7cfb\u7edf\u4e0a\uff0c\u4e0eWindows\u7cfb\u7edf\u6709\u826f\u597d\u7684\u517c\u5bb9\u6027\u3002<\/li>\n<\/p>\n<li>\n<p><p><strong>Lighttpd<\/strong>\uff1aLighttpd\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684Web\u670d\u52a1\u5668\uff0c\u9002\u7528\u4e8e\u5d4c\u5165\u5f0f\u7cfb\u7edf\u548c\u8d44\u6e90\u53d7\u9650\u7684\u73af\u5883\u3002<\/li>\n<\/p>\n<li>\n<p><p><strong>Tomcat<\/strong>\uff1aApache Tomcat\u662fJava Servlet\u548cJavaServer Pages\uff08JSP\uff09\u6280\u672f\u7684\u5b98\u65b9\u53c2\u8003\u5b9e\u73b0\uff0c\u9002\u7528\u4e8e\u8fd0\u884cJava Web\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<\/p>\n<\/ol>\n<p><h3>Apache HTTP Server\u7684\u914d\u7f6e<\/h3>\n<\/p>\n<p><p>Apache HTTP Server\u7684\u914d\u7f6e\u76f8\u5bf9\u590d\u6742\uff0c\u4f46\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7684\u914d\u7f6e\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><p>\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6 <code>\/etc\/httpd\/conf\/httpd.conf<\/code><\/li>\n<\/p>\n<li>\n<p><p>\u8bbe\u7f6e\u865a\u62df\u4e3b\u673a\uff08VirtualHosts\uff09<\/p>\n<\/p>\n<p><pre><code>ServerName example.com<\/p>\r\n<p>DocumentRoot \/var\/www\/example.com<\/p>\r\n<p>ErrorLog \/var\/log\/httpd\/example.com_error.log<\/p>\r\n<p>CustomLog \/var\/log\/httpd\/example.com_access.log combined<\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><p>\u914d\u7f6eSSL\u8bc1\u4e66<\/p>\n<\/p>\n<p><pre><code>SSLCertificateFile \/path\/to\/certificate.pem<\/p>\r\n<p>SSLCertificateKeyFile \/path\/to\/private.key<\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><p>\u91cd\u542fApache\u670d\u52a1\u5668\u4ee5\u5e94\u7528\u914d\u7f6e\u66f4\u6539<\/p>\n<\/p>\n<p><pre><code>sudo systemctl restart httpd<\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>Nginx\u7684\u914d\u7f6e<\/h3>\n<\/p>\n<p><p>Nginx\u7684\u914d\u7f6e\u6587\u4ef6\u4f4d\u4e8e <code>\/etc\/nginx\/nginx.conf<\/code>\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u914d\u7f6e\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><p>\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6 <code>\/etc\/nginx\/nginx.conf<\/code><\/li>\n<\/p>\n<li>\n<p><p>\u914d\u7f6e\u670d\u52a1\u5668\u5757\uff08Server Block\uff09<\/p>\n<\/p>\n<p><pre><code>server {<\/p>\r\n<p>    listen       80;<\/p>\r\n<p>    server_name  example.com www.example.com;<\/p>\r\n<p>    location \/ {<\/p>\r\n<p>        root   \/var\/www\/example.com;<\/p>\r\n<p>        index  index.html index.htm;<\/p>\r\n<p>    }<\/p>\r\n<p>}<\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><p>\u914d\u7f6eSSL\u8bc1\u4e66<\/p>\n<\/p>\n<p><pre><code>server {<\/p>\r\n<p>    listen       443 ssl;<\/p>\r\n<p>    server_name  example.com www.example.com;<\/p>\r\n<p>    ssl_certificate \/path\/to\/certificate.pem;<\/p>\r\n<p>    ssl_certificate_key \/path\/to\/private.key;<\/p>\r\n<p>    ...<\/p>\r\n<p>}<\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><p>\u91cd\u542fNginx\u670d\u52a1\u5668\u4ee5\u5e94\u7528\u914d\u7f6e\u66f4\u6539<\/p>\n<\/p>\n<p><pre><code>sudo systemctl restart nginx<\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u5982\u4f55\u4e3aApache\u548cNginx\u914d\u7f6eSSL\u8bc1\u4e66\uff1f<\/h3>\n<\/p>\n<p><p><b>\u5982\u4f55\u4e3aApache\u914d\u7f6eSSL\u8bc1\u4e66\uff1f<\/b><\/p>\n<\/p>\n<p><p>1. \u83b7\u53d6SSL\u8bc1\u4e66\uff08\u53ef\u4ee5\u4eceLet&#8217;s Encrypt\u514d\u8d39\u83b7\u53d6\uff09<\/p>\n<\/p>\n<p><p>2. \u5c06\u8bc1\u4e66\u6587\u4ef6\u548c\u79c1\u94a5\u6587\u4ef6\u653e\u7f6e\u5728\u9002\u5f53\u7684\u4f4d\u7f6e<\/p>\n<\/p>\n<p><p>3. \u7f16\u8f91Apache\u914d\u7f6e\u6587\u4ef6\uff0c\u5982\u524d\u6240\u8ff0\uff0c\u6dfb\u52a0SSL\u76f8\u5173\u914d\u7f6e<\/p>\n<\/p>\n<p><p>4. \u91cd\u542fApache\u670d\u52a1\u5668\u4ee5\u5e94\u7528\u914d\u7f6e\u66f4\u6539<\/p>\n<\/p>\n<p><p><b>\u5982\u4f55\u4e3aNginx\u914d\u7f6eSSL\u8bc1\u4e66\uff1f<\/b><\/p>\n<\/p>\n<p><p>1. \u83b7\u53d6SSL\u8bc1\u4e66\uff08\u53ef\u4ee5\u4eceLet&#8217;s Encrypt\u514d\u8d39\u83b7\u53d6\uff09<\/p>\n<\/p>\n<p><p>2. \u5c06\u8bc1\u4e66\u6587\u4ef6\u548c\u79c1\u94a5\u6587\u4ef6\u653e\u7f6e\u5728\u9002\u5f53\u7684\u4f4d\u7f6e<\/p>\n<\/p>\n<p><p>3. \u7f16\u8f91Nginx\u914d\u7f6e\u6587\u4ef6\uff0c\u5982\u524d\u6240\u8ff0\uff0c\u6dfb\u52a0SSL\u76f8\u5173\u914d\u7f6e<\/p>\n<\/p>\n<p><p>4. \u91cd\u542fNginx\u670d\u52a1\u5668\u4ee5\u5e94\u7528\u914d\u7f6e\u66f4\u6539<\/p>\n<\/p>\n<p><p><b>Apache\u548cNginx\u54ea\u4e2a\u66f4\u9002\u5408\u9ad8\u5e76\u53d1\u7f51\u7ad9\uff1f<\/b><\/p>\n<\/p>\n<p><p>Nginx\u66f4\u9002\u5408\u9ad8\u5e76\u53d1\u7f51\u7ad9\uff0c\u56e0\u4e3a\u5b83\u5177\u6709\u66f4\u9ad8\u7684\u6027\u80fd\u548c\u66f4\u4f4e\u7684\u8d44\u6e90\u6d88\u8017\u3002\u7136\u800c\uff0c\u8fd9\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\u548c\u9700\u6c42\uff0c\u6709\u65f6\u5019Apache\u53ef\u80fd\u66f4\u9002\u5408\u67d0\u4e9b\u7279\u5b9a\u60c5\u51b5\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a8\u8350Web\u670d\u52a1\u5668\u8f6f\u4ef6\u6392\u884c\u699c \u5728\u4f17\u591aWeb\u670d\u52a1\u5668\u8f6f\u4ef6\u4e2d\uff0c\u4ee5\u4e0b\u51e0\u79cd\u56e0\u5176\u7a33\u5b9a\u6027\u548c\u6613\u7528\u6027\u800c\u53d7\u5230\u5e7f\u6cdb\u63a8\u8350\uff1a Apache\uff1aApache HTTP Server\u662f\u4e16\u754c\u4e0a\u6700\u6d41\u884c\u7684Web\u670d\u52a1\u5668\u8f6f\u4ef6\u4e4b\u4e00\uff0c\u5177\u6709\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u652f\u6301\u5e7f\u6cdb\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4e14\u793e\u533a\u652f\u6301\u4e30\u5bcc\u3002 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":528,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[217,133,236],"topic":[],"class_list":["post-527","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-usa-server","tag-apache","tag-web","tag-236"],"_links":{"self":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/comments?post=527"}],"version-history":[{"count":1,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/527\/revisions"}],"predecessor-version":[{"id":530,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/527\/revisions\/530"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media\/528"}],"wp:attachment":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media?parent=527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/categories?post=527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/tags?post=527"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/topic?post=527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}