{"id":230077,"date":"2023-12-25T14:31:20","date_gmt":"2023-12-25T06:31:20","guid":{"rendered":"https:\/\/www.idc.net\/help\/230077\/"},"modified":"2023-12-25T14:31:20","modified_gmt":"2023-12-25T06:31:20","slug":"apache%e6%96%b0%e6%89%8b%e6%95%99%e7%a8%8b%ef%bc%9a%e6%9b%b4%e6%96%b0lets-encrypt%e8%af%81%e4%b9%a6","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/230077\/","title":{"rendered":"Apache\u65b0\u624b\u6559\u7a0b\uff1a\u66f4\u65b0Let&#8217;s Encrypt\u8bc1\u4e66"},"content":{"rendered":"<p><title id=\"apache%e6%96%b0%e6%89%8b%e6%95%99%e7%a8%8b%ef%bc%9a%e6%9b%b4%e6%96%b0lets-encrypt%e8%af%81%e4%b9%a6-lrnpgOVWzm\">Apache\u65b0\u624b\u6559\u7a0b\uff1a\u66f4\u65b0Let's Encrypt\u8bc1\u4e66<\/title><\/p>\n<h1 id=\"apache%e6%96%b0%e6%89%8b%e6%95%99%e7%a8%8b%ef%bc%9a%e6%9b%b4%e6%96%b0lets-encrypt%e8%af%81%e4%b9%a6-lrnpgOVWzm\">Apache\u65b0\u624b\u6559\u7a0b\uff1a\u66f4\u65b0Let's Encrypt\u8bc1\u4e66<\/h1>\n<p>\u5728\u4eca\u5929\u7684\u6570\u5b57\u65f6\u4ee3\uff0c\u7f51\u7ad9\u5b89\u5168\u6027\u53d8\u5f97\u8d8a\u6765\u8d8a\u91cd\u8981\u3002\u4e3a\u4e86\u4fdd\u62a4\u7f51\u7ad9\u548c\u7528\u6237\u7684\u9690\u79c1\uff0c\u4f7f\u7528SSL\u8bc1\u4e66\u6765\u52a0\u5bc6\u7f51\u7ad9\u6d41\u91cf\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002Let's Encrypt\u662f\u4e00\u4e2a\u514d\u8d39\u7684\u8bc1\u4e66\u9881\u53d1\u673a\u6784\uff0c\u53ef\u4ee5\u4e3a\u60a8\u7684\u7f51\u7ad9\u63d0\u4f9b\u514d\u8d39\u7684SSL\u8bc1\u4e66\u3002\u672c\u6559\u7a0b\u5c06\u5411\u60a8\u5c55\u793a\u5982\u4f55\u5728Apache\u670d\u52a1\u5668\u4e0a\u66f4\u65b0Let's Encrypt\u8bc1\u4e66\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%aa%a41%ef%bc%9a%e5%ae%89%e8%a3%85certbot-lrnpgOVWzm\">\u6b65\u9aa41\uff1a\u5b89\u88c5Certbot<\/h2>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88c5Certbot\u5de5\u5177\uff0c\u5b83\u662f\u4e00\u4e2a\u7528\u4e8e\u81ea\u52a8\u5316\u8bc1\u4e66\u7533\u8bf7\u548c\u66f4\u65b0\u7684\u5de5\u5177\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5728Ubuntu\u4e0a\u5b89\u88c5Certbot\uff1a<\/p>\n<pre><code>sudo apt-get update\nsudo apt-get install certbot<\/code><\/pre>\n<p>\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u5176\u4ed6Linux\u53d1\u884c\u7248\uff0c\u8bf7\u53c2\u8003Certbot\u7684\u5b98\u65b9\u6587\u6863\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%aa%a42%ef%bc%9a%e7%94%9f%e6%88%90lets-encrypt%e8%af%81%e4%b9%a6-lrnpgOVWzm\">\u6b65\u9aa42\uff1a\u751f\u6210Let's Encrypt\u8bc1\u4e66<\/h2>\n<p>\u4e00\u65e6Certbot\u5b89\u88c5\u5b8c\u6210\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u751f\u6210Let's Encrypt\u8bc1\u4e66\uff1a<\/p>\n<pre><code>sudo certbot certonly --apache<\/code><\/pre>\n<p>\u8fd9\u5c06\u81ea\u52a8\u68c0\u6d4b\u60a8\u7684Apache\u914d\u7f6e\uff0c\u5e76\u4e3a\u60a8\u7684\u57df\u540d\u751f\u6210\u8bc1\u4e66\u3002\u60a8\u9700\u8981\u6309\u7167\u63d0\u793a\u8f93\u5165\u60a8\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u548c\u540c\u610f\u6761\u6b3e\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%aa%a43%ef%bc%9a%e9%85%8d%e7%bd%aeapache%e6%9c%8d%e5%8a%a1%e5%99%a8-lrnpgOVWzm\">\u6b65\u9aa43\uff1a\u914d\u7f6eApache\u670d\u52a1\u5668<\/h2>\n<p>\u751f\u6210\u8bc1\u4e66\u540e\uff0c\u60a8\u9700\u8981\u914d\u7f6eApache\u670d\u52a1\u5668\u4ee5\u4f7f\u7528\u65b0\u7684\u8bc1\u4e66\u3002\u6253\u5f00Apache\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u901a\u5e38\u4f4d\u4e8e<code>\/etc\/apache2\/sites-available\/<\/code>\u76ee\u5f55\u4e0b\uff1a<\/p>\n<pre><code>sudo nano \/etc\/apache2\/sites-available\/your_domain.conf<\/code><\/pre>\n<p>\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u627e\u5230\u4ee5\u4e0b\u884c\uff1a<\/p>\n<pre><code>SSLCertificateFile \/path\/to\/old_certificate.crt\nSSLCertificateKeyFile \/path\/to\/old_private_key.key<\/code><\/pre>\n<p>\u5c06\u5176\u66ff\u6362\u4e3a\u65b0\u751f\u6210\u7684\u8bc1\u4e66\u548c\u79c1\u94a5\u7684\u8def\u5f84\uff1a<\/p>\n<pre><code>SSLCertificateFile \/etc\/letsencrypt\/live\/your_domain\/fullchain.pem\nSSLCertificateKeyFile \/etc\/letsencrypt\/live\/your_domain\/privkey.pem<\/code><\/pre>\n<p>\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%aa%a44%ef%bc%9a%e9%87%8d%e5%90%afapache%e6%9c%8d%e5%8a%a1%e5%99%a8-lrnpgOVWzm\">\u6b65\u9aa44\uff1a\u91cd\u542fApache\u670d\u52a1\u5668<\/h2>\n<p>\u5b8c\u6210\u914d\u7f6e\u540e\uff0c\u60a8\u9700\u8981\u91cd\u542fApache\u670d\u52a1\u5668\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\uff1a<\/p>\n<pre><code>sudo service apache2 restart<\/code><\/pre>\n<p>\u73b0\u5728\uff0c\u60a8\u7684Apache\u670d\u52a1\u5668\u5df2\u7ecf\u6210\u529f\u66f4\u65b0\u4e86Let's Encrypt\u8bc1\u4e66\u3002<\/p>\n<h2 id=\"%e6%80%bb%e7%bb%93-lrnpgOVWzm\">\u603b\u7ed3<\/h2>\n<p>\u901a\u8fc7\u672c\u6559\u7a0b\uff0c\u60a8\u5b66\u4f1a\u4e86\u5982\u4f55\u5728Apache\u670d\u52a1\u5668\u4e0a\u66f4\u65b0Let's Encrypt\u8bc1\u4e66\u3002\u4f7f\u7528\u514d\u8d39\u7684Let's Encrypt\u8bc1\u4e66\u53ef\u4ee5\u4e3a\u60a8\u7684\u7f51\u7ad9\u63d0\u4f9b\u66f4\u9ad8\u7684\u5b89\u5168\u6027\u548c\u4fdd\u62a4\u7528\u6237\u9690\u79c1\u3002\u5982\u679c\u60a8\u6b63\u5728\u5bfb\u627e\u53ef\u9760\u7684\u9999\u6e2f\u670d\u52a1\u5668\u63d0\u4f9b\u5546\uff0c\u540e\u6d6a\u4e91\u662f\u60a8\u7684\u9996\u9009\u3002\u6211\u4eec\u63d0\u4f9b\u9ad8\u6027\u80fd\u7684\u9999\u6e2f\u670d\u52a1\u5668\uff0c\u4ee5\u53ca10\u5143\u9999\u6e2f\u670d\u52a1\u5668\u548c\u9999\u6e2f\u670d\u52a1\u5668\u514d\u8d39\u8bd5\u7528\u3002\u8bf7\u8bbf\u95ee\u6211\u4eec\u7684\u5b98\u7f51\u4e86\u89e3\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n<p><a href=\"https:\/\/idc.net\">\u540e\u6d6a\u4e91\u5b98\u7f51<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache\u65b0\u624b\u6559\u7a0b\uff1a\u66f4\u65b0Let's Encrypt\u8bc1\u4e66 Apache\u65b0\u624b\u6559\u7a0b\uff1a\u66f4\u65b0Let's Encrypt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[],"class_list":["post-230077","post","type-post","status-publish","format-standard","hentry","category-apache"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/230077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=230077"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/230077\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=230077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=230077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=230077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}