{"id":3432,"date":"2023-04-14T13:33:31","date_gmt":"2023-04-14T05:33:31","guid":{"rendered":"https:\/\/app.applebyme.cn\/cloud\/?p=3432"},"modified":"2023-04-14T13:33:31","modified_gmt":"2023-04-14T05:33:31","slug":"%e5%85%8d%e8%b4%b9ssl%e8%af%81%e4%b9%a6%e8%af%a5%e5%a6%82%e4%bd%95%e7%94%b3%e8%af%b7-2","status":"publish","type":"post","link":"https:\/\/app.applebyme.cn\/cloud\/https\/3432.html","title":{"rendered":"\u514d\u8d39ssl\u8bc1\u4e66\u8be5\u5982\u4f55\u7533\u8bf7"},"content":{"rendered":"<p>SSL\u8bc1\u4e66\u662f\u4e00\u79cd\u6570\u5b57\u8bc1\u4e66\uff0c\u7528\u4e8e\u52a0\u5bc6\u7f51\u7ad9\u548c\u7528\u6237\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\uff0c\u4ece\u800c\u4fdd\u969c\u4fe1\u606f\u5b89\u5168\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u8d2d\u4e70SSL\u8bc1\u4e66\u9700\u8981\u652f\u4ed8\u4e00\u5b9a\u7684\u8d39\u7528\uff0c\u4f46\u662f\u4e5f\u6709\u4e00\u4e9b\u514d\u8d39\u7684SSL\u8bc1\u4e66\u53ef\u4f9b\u7533\u8bf7\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u514d\u8d39SSL\u8bc1\u4e66\u7684\u7533\u8bf7\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n<p>\u4e00\u3001\u514d\u8d39SSL\u8bc1\u4e66\u7684\u539f\u7406<\/p>\n<p>\u514d\u8d39SSL\u8bc1\u4e66\u7684\u539f\u7406\u662f\u57fa\u4e8eACME\u534f\u8bae\uff0c\u5373\u81ea\u52a8\u5316\u8bc1\u4e66\u7ba1\u7406\u73af\u5883\u534f\u8bae\u3002\u8fd9\u4e2a\u534f\u8bae\u53ef\u4ee5\u901a\u8fc7\u81ea\u52a8\u5316\u7684\u65b9\u5f0f\u5b9e\u73b0\u8bc1\u4e66\u7684\u7533\u8bf7\u3001\u9a8c\u8bc1\u548c\u7eed\u671f\u7b49\u64cd\u4f5c\uff0c\u800c\u4e0d\u9700\u8981\u4eba\u5de5\u5e72\u9884\u3002\u76ee\u524d\uff0c\u6709\u4e00\u4e9b\u5f00\u6e90\u7684ACME\u5ba2\u6237\u7aef\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u7533\u8bf7\u514d\u8d39SSL\u8bc1\u4e66\u3002<\/p>\n<p>\u4e8c\u3001\u514d\u8d39SSL\u8bc1\u4e66\u7684\u7533\u8bf7\u6b65\u9aa4<\/p>\n<p>1. \u9009\u62e9ACME\u5ba2\u6237\u7aef\u5de5\u5177<\/p>\n<p>\u76ee\u524d\uff0c\u5e02\u9762\u4e0a\u6709\u5f88\u591aACME\u5ba2\u6237\u7aef\u5de5\u5177\u53ef\u4f9b\u9009\u62e9\uff0c\u4f8b\u5982Certbot\u3001ACME.sh\u3001ZeroSSL\u7b49\u3002\u4e0d\u540c\u7684\u5de5\u5177\u53ef\u80fd\u6709\u4e0d\u540c\u7684\u4f7f\u7528\u65b9\u5f0f\u548c\u652f\u6301\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u9700\u8981\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u3002<\/p>\n<p>2. \u5b89\u88c5\u548c\u914d\u7f6eACME\u5ba2\u6237\u7aef\u5de5\u5177<\/p>\n<p>\u5b89\u88c5\u548c\u914d\u7f6eACME\u5ba2\u6237\u7aef\u5de5\u5177\u7684\u8fc7\u7a0b\u56e0\u5de5\u5177\u800c\u5f02\uff0c\u4e00\u822c\u9700\u8981\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u547d\u4ee4\u6765\u5b8c\u6210\u5b89\u88c5\u548c\u914d\u7f6e\u3002\u4ee5Certbot\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>sudo apt-g<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-03\/09\/15\/13603662863.jpg\" \/><\/figure>\n<\/p>\n<p>et update<\/p>\n<p>sudo apt-get install software-properties-common<\/p>\n<p>sudo add-apt-repository universe<\/p>\n<p>sudo add-apt-repository ppa:certbot\/certbot<\/p>\n<p>sudo apt-get update<\/p>\n<p>sudo apt-get install certbot python3-certbot-nginx<\/p>\n<p>&#8220;`<\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u9700\u8981\u914d\u7f6eCertbot\u7684Nginx\u63d2\u4ef6\uff0c\u4ee5\u4fbf\u81ea\u52a8\u914d\u7f6eSSL\u8bc1\u4e66\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b8c\u6210\u914d\u7f6e\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>sudo certbot &#8211;nginx<\/p>\n<p>&#8220;`<\/p>\n<p>3. \u7533\u8bf7SSL\u8bc1\u4e66<\/p>\n<p>\u5b8c\u6210ACME\u5ba2\u6237\u7aef\u5de5\u5177\u7684\u5b89\u88c5\u548c\u914d\u7f6e\u540e\uff0c\u5c31\u53ef\u4ee5\u7533\u8bf7SSL\u8bc1\u4e66\u4e86\u3002\u4ee5Certbot\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u7533\u8bf7\u8bc1\u4e66\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>sudo certbot certonly &#8211;webroot -w \/var\/www\/html -d example.com -d www.example.com<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0c-w\u53c2\u6570\u6307\u5b9a\u7f51\u7ad9\u7684\u6839\u76ee\u5f55\uff0c-d\u53c2\u6570\u6307\u5b9a\u9700\u8981\u7533\u8bf7\u8bc1\u4e66\u7684\u57df\u540d\u3002\u7533\u8bf7\u5b8c\u6210\u540e\uff0c\u8bc1\u4e66\u6587\u4ef6\u4f1a\u4fdd\u5b58\u5728\/etc\/letsencrypt\/live\u76ee\u5f55\u4e0b\u3002<\/p>\n<p>4. \u914d\u7f6e\u7f51\u7ad9\u4f7f\u7528SSL\u8bc1\u4e66<\/p>\n<p>\u7533\u8bf7\u5230SSL\u8bc1\u4e66\u540e\uff0c\u8fd8\u9700\u8981\u914d\u7f6e\u7f51\u7ad9\u4f7f\u7528\u8be5\u8bc1\u4e66\u3002\u4ee5Nginx\u670d\u52a1\u5668\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u914d\u7f6e\u6587\u4ef6\u6765\u542f\u7528SSL\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>server {<\/p>\n<p>    listen 443 ssl;<\/p>\n<p>    server_name example.com;<\/p>\n<p>    ssl_certificate \/etc\/letsencrypt\/live\/example.com\/fullchain.pem;<\/p>\n<p>    ssl_certificate_key \/etc\/letsencrypt\/live\/example.com\/privkey.pem;<\/p>\n<p>    location \/ {<\/p>\n<p>        # &#8230;<\/p>\n<p>    }<\/p>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cssl_certificate\u548cssl_certificate_key\u5206\u522b\u6307\u5b9aSSL\u8bc1\u4e66\u548c\u79c1\u94a5\u7684\u8def\u5f84\u3002\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u91cd\u542fNginx\u670d\u52a1\u5668\uff0c\u5373\u53ef\u542f\u7528SSL\u3002<\/p>\n<p>5. \u81ea\u52a8\u7eed\u671fSSL\u8bc1\u4e66<\/p>\n<p>\u514d\u8d39SSL\u8bc1\u4e66\u7684\u6709\u6548\u671f\u4e00\u822c\u4e3a90\u5929\uff0c\u9700\u8981\u5b9a\u671f\u7eed\u671f\u3002ACME\u5ba2\u6237\u7aef\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u81ea\u52a8\u7eed\u671f\u8bc1\u4e66\uff0c\u65e0\u9700\u4eba\u5de5\u5e72\u9884\u3002\u4ee5Certbot\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u81ea\u52a8\u7eed\u671f\u8bc1\u4e66\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>sudo certbot renew<\/p>\n<p>&#8220;`<\/p>\n<p>\u8be5\u547d\u4ee4\u4f1a\u68c0\u67e5\u6240\u6709\u5df2\u5b89\u88c5\u7684\u8bc1\u4e66\uff0c\u5e76\u81ea\u52a8\u7eed\u671f\u5373\u5c06\u8fc7\u671f\u7684\u8bc1\u4e66\u3002<\/p>\n<p>\u603b\u7ed3<\/p>\n<p>\u514d\u8d39SSL\u8bc1\u4e66\u7684\u7533\u8bf7\u539f\u7406\u548c\u6b65\u9aa4\u90fd\u6bd4\u8f83\u7b80\u5355\uff0c\u53ea\u9700\u8981\u9009\u62e9\u5408\u9002\u7684ACME\u5ba2\u6237\u7aef\u5de5\u5177\u5e76\u6309\u7167\u6307\u5f15\u4e00\u6b65\u6b65\u64cd\u4f5c\u5373\u53ef\u3002\u4e0d\u8fc7\uff0c\u9700\u8981\u6ce8\u610f\u7684<a href=\"https:\/\/www.yimenssl.cn\/ssl-shenqing-756.html\">\u54ea\u91cc\u53ef\u4ee5\u7533\u8bf7\u56fd\u5bc6ssl\u8bc1\u4e66<\/a>\u662f\uff0c\u514d\u8d39SSL\u8bc1\u4e66\u7684\u5b89\u5168\u6027\u53ef\u80fd\u4e0d\u5982\u4ed8\u8d39\u8bc1\u4e66\uff0c\u56e0\u6b64\u5728\u9009\u62e9SSL\u8bc1\u4e66\u65f6\u9700\u8981\u8003\u8651\u591a\u65b9\u9762\u56e0\u7d20\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSL\u8bc1\u4e66\u662f\u4e00\u79cd\u6570\u5b57\u8bc1\u4e66\uff0c\u7528\u4e8e\u52a0\u5bc6\u7f51\u7ad9\u548c\u7528\u6237\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\uff0c\u4ece\u800c\u4fdd\u969c\u4fe1\u606f\u5b89\u5168\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u8d2d\u4e70SSL\u8bc1\u4e66\u9700\u8981\u652f\u4ed8\u4e00\u5b9a\u7684\u8d39\u7528\uff0c\u4f46\u662f\u4e5f\u6709\u4e00\u4e9b\u514d\u8d39\u7684SSL\u8bc1\u4e66\u53ef\u4f9b\u7533\u8bf7\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u514d\u8d39SSL\u8bc1\u4e66\u7684\u7533\u8bf7\u539f\u7406\u548c<\/p>\n","protected":false},"author":26,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2145],"tags":[3935,3934,3418,960,754],"class_list":["post-3432","post","type-post","status-publish","format-standard","hentry","category-https","tag-android-https","tag-https","tag-3418","tag-960","tag-754"],"_links":{"self":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/3432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/comments?post=3432"}],"version-history":[{"count":0,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/3432\/revisions"}],"wp:attachment":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/media?parent=3432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/categories?post=3432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/tags?post=3432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}