{"id":111,"date":"2021-10-15T17:56:02","date_gmt":"2021-10-15T09:56:02","guid":{"rendered":"https:\/\/www.suqin.site\/?p=111"},"modified":"2021-10-15T17:56:22","modified_gmt":"2021-10-15T09:56:22","slug":"ubuntu-16-04%e4%bd%bf%e7%94%a8lets-encrypt%e9%85%8d%e7%bd%aessl%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.suqin.site\/?p=111","title":{"rendered":"Ubuntu 16.04\u4f7f\u7528Let&#8217;s Encrypt\u914d\u7f6eSSL\u6559\u7a0b"},"content":{"rendered":"\n<p class=\"has-small-font-size\">\u5f00\u59cb\u4e4b\u524d\uff0c\u4f60\u9700\u8981\uff1a<\/p>\n\n\n\n<ul class=\"has-small-font-size\"><li>\u5728\u4f60\u7684Ubuntu16.04\u670d\u52a1\u5668\u4e0b\u6709\u4e2a\u5177\u5907sudo\u6743\u9650\u7684\u975eroot\u8d26\u6237<\/li><li>\u4f60\u7684\u670d\u52a1\u5668\u914d\u7f6e\u597d\u4e86\u4e00\u4e2a\u6216\u591a\u4e2a\u57df\u540d<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">1.\u5b89\u88c5Let\u2019s Encrypt\u5ba2\u6237\u7aef<\/h2>\n\n\n\n<p class=\"has-small-font-size\">\u6211\u4eec\u8981\u901a\u8fc7\u5b98\u65b9\u7684\u6700\u65b0\u6587\u4ef6\u6e90\u6765\u786e\u4fdd\u5b89\u88c5\u6700\u65b0\u7248\u7684\u5ba2\u6237\u7aef\uff0c\u56e0\u6b64\u5728\u901a\u8fc7SSH\u8fdc\u7a0b\u94fe\u63a5\u4f60\u7684\u670d\u52a1\u5668\u540e\uff0c\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\u6dfb\u52a0\u6587\u4ef6\u6e90\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>sudo add-apt-repository ppa:certbot\/certbot<\/code><\/pre>\n\n\n\n<p class=\"has-small-font-size\">\u786e\u8ba4\u5b89\u88c5\u540e\uff0cupdate\u4e0bUbuntu\u7684\u914d\u7f6e\u5305\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>sudo apt-get update<\/code><\/pre>\n\n\n\n<p class=\"has-small-font-size\">\u6700\u540e\u5b89\u88c5\u4e13\u95e8\u9762\u5411Nginx\/Apache\u670d\u52a1\u5668\u7684\u5ba2\u6237\u7aef\uff0c\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>sudo apt-get install python-certbot-nginx\n\n<span class=\"has-inline-color has-cyan-bluish-gray-color\">##Apache\u5219\u4e3a <meta charset=\"utf-8\">sudo apt-get install python-certbot-apache<\/span><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2.\u8bbe\u7f6eSSL\u8bc1\u4e66<\/h2>\n\n\n\n<p class=\"has-small-font-size\">\u5982\u679c\u4f60\u53ea\u6709\u4e00\u4e2a\u57df\u540d\u9700\u8981\u914d\u7f6eSSL\u8bc1\u4e66\uff0c\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u4e00\u4e0b\u547d\u4ee4\u6765\u901a\u8fc7\u5ba2\u6237\u7aef\u81ea\u52a8\u5b8c\u6210\u914d\u7f6e\u529f\u80fd\uff08\u5176\u4e2dexample.com\u5047\u8bbe\u4e3a\u4f60\u7684\u57df\u540d\uff09:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>sudo certbot --nginx -d <span class=\"has-inline-color has-vivid-red-color\">example.com<\/span>\n\n<span class=\"has-inline-color has-cyan-bluish-gray-color\">##<meta charset=\"utf-8\">Apache\u5219\u4e3a <meta charset=\"utf-8\">sudo certbot --apache -d example.com<\/span><\/code><\/pre>\n\n\n\n<p class=\"has-small-font-size\">\u5982\u679c\u4f60\u6709\u591a\u4e2a\u57df\u540d\uff0c\u6216\u8005\u5b50\u57df\u540d\u9700\u8981\u4e00\u5e76\u914d\u7f6e\uff0c\u53ef\u4ee5\u5c06\u4f60\u7684\u6700\u6838\u5fc3\u7684\u57df\u540d\u653e\u5728\u6700\u524d\u9762\uff0c\u5176\u4ed6\u7684\u9646\u7eed\u901a\u8fc7-d\u53c2\u4e0e\u8ddf\u968f\u5728\u540e\u65b9\uff0c\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>sudo certbot --nginx -d <span class=\"has-inline-color has-vivid-red-color\">example.com<\/span> -d <span class=\"has-inline-color has-vivid-red-color\">www.example.com<\/span>\u00a0-d <span class=\"has-inline-color has-vivid-red-color\">m.example.com<\/span>\n\n<span class=\"has-inline-color has-cyan-bluish-gray-color\">##Apache\u5219\u4e3a <meta charset=\"utf-8\">sudo certbot --apache -d example.com -d www.example.com\u00a0-d m.example.com<\/span><\/code><\/pre>\n\n\n\n<p class=\"has-small-font-size\">\u7b49\u5230\u6d41\u7a0b\u8dd1\u5b8c\uff0c\u4f60\u5c31\u53ef\u4ee5\u5728\/etc\/letsencrypt\/live\u8fd9\u4e2a\u8def\u5f84\u4e0b\u627e\u5230\u4f60\u7684\u8bc1\u4e66\uff0c\u4f60\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u7f51\u5740\u6765\u786e\u8ba4\u4f60\u7684\u8bc1\u4e66\u662f\u5426\u751f\u6548\uff0c\u5176\u4e2dexample.com\u4e3a\u4f60\u914d\u7f6e\u7684\u57df\u540d\uff1a<\/p>\n\n\n\n<p class=\"has-small-font-size\">https:\/\/www.ssllabs.com\/ssltest\/analyze.html?d=<span class=\"has-inline-color has-vivid-red-color\">example.com<\/span>&amp;latest<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3.\u8bbe\u7f6e\u5ba2\u6237\u7aef\u81ea\u52a8\u66f4\u65b0\u8bc1\u4e66<\/h2>\n\n\n\n<p class=\"has-small-font-size\">Let\u2019s Encrypt\u53ea\u670990\u5929\u6709\u6548\u671f\uff0c\u4f46\u5ba2\u6237\u7aef\u652f\u6301\u63d0\u524d30\u5929\u81ea\u52a8\u66f4\u65b0\uff0c\u53ea\u9700\u8981\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>sudo certbot renew --dry-run<\/code><\/pre>\n\n\n\n<p class=\"has-small-font-size\">\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u62a5\u9519\uff0c\u8bbe\u7f6e\u5b8c\u6210\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f00\u59cb\u4e4b\u524d\uff0c\u4f60\u9700\u8981\uff1a \u5728\u4f60\u7684Ubuntu16.04\u670d\u52a1\u5668\u4e0b\u6709\u4e2a\u5177\u5907sudo\u6743\u9650\u7684\u975eroot\u8d26\u6237 \u4f60\u7684\u670d\u52a1\u5668\u914d\u7f6e\u597d&hellip; <a class=\"more-link\" href=\"https:\/\/www.suqin.site\/?p=111\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">Ubuntu 16.04\u4f7f\u7528Let&#8217;s Encrypt\u914d\u7f6eSSL\u6559\u7a0b<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[16,15],"_links":{"self":[{"href":"https:\/\/www.suqin.site\/index.php?rest_route=\/wp\/v2\/posts\/111"}],"collection":[{"href":"https:\/\/www.suqin.site\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.suqin.site\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.suqin.site\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.suqin.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=111"}],"version-history":[{"count":20,"href":"https:\/\/www.suqin.site\/index.php?rest_route=\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":131,"href":"https:\/\/www.suqin.site\/index.php?rest_route=\/wp\/v2\/posts\/111\/revisions\/131"}],"wp:attachment":[{"href":"https:\/\/www.suqin.site\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.suqin.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.suqin.site\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}