{"id":1100,"date":"2016-02-22T22:08:37","date_gmt":"2016-02-22T06:08:37","guid":{"rendered":"http:\/\/hesiwei.cn\/?p=1100"},"modified":"2016-02-22T22:08:37","modified_gmt":"2016-02-22T06:08:37","slug":"lets-encrypt","status":"publish","type":"post","link":"http:\/\/hesiwei.cn\/?p=1100","title":{"rendered":"\u4f7f\u7528 Let\u2019s Encrypt \u52a0\u5bc6(HTTPS)\u7f51\u7ad9"},"content":{"rendered":"<h2 id=\"toc_0\">\u5b89\u88c5 Let\u2019s Encrypt \u5ba2\u6237\u7aef<\/h2>\n<p>\u5148\u66f4\u65b0\u7cfb\u7edf\u548c\u5b89\u88c5 git\uff0c\u4e0b\u8f7d Let\u2019s Encrypt<\/p>\n<pre><code>git clone https:\/\/github.com\/letsencrypt\/letsencrypt\ncd letsencrypt\n<\/code><\/pre>\n<h2 id=\"toc_1\">\u83b7\u53d6\u8bc1\u4e66<\/h2>\n<p>\u9996\u5148\u5173\u95ed Nginx\uff1a<\/p>\n<pre><code>service nginx stop\n<\/code><\/pre>\n<p>\u751f\u6210\u8bc1\u4e66<\/p>\n<pre><code>.\/letsencrypt-auto certonly --email \u90ae\u7bb1 -d \u57df\u540d --webroot -w \/\u7f51\u7ad9\u76ee\u5f55\u5b8c\u6574\u8def\u5f84 --agree-tos\n<\/code><\/pre>\n<p>\u8bc1\u4e66\u5df2\u7ecf\u7b7e\u53d1\u6210\u529f\uff0c\u4f4d\u4e8e <code>\/etc\/letsencrypt<\/code>\u57df\u540d\u4e0b<\/p>\n<pre><code>cert.pem: \u57df\u540d\u8bc1\u4e66\nchain.pem: The Let\u2019s Encrypt \u8bc1\u4e66\nfullchain.pem: \u4e0a\u9762\u4e24\u8005\u5408\u4f53\nprivkey.pem: \u8bc1\u4e66\u5bc6\u94a5\n<\/code><\/pre>\n<h2 id=\"toc_2\">\u81ea\u52a8\u7eed\u7b7e\u8bc1\u4e66<\/h2>\n<pre><code class=\"language-cat\">#!\/bin\/bash\nmkdir -p \/\u7f51\u7ad9\u76ee\u5f55\u5b8c\u6574\u8def\u5f84\/.well-known\/acme-challenge\n\/root\/letsencrypt\/letsencrypt-auto --renew-by-default certonly --email \u90ae\u7bb1 -d \u57df\u540d --webroot -w \/\u7f51\u7ad9\u76ee\u5f55\u5b8c\u6574\u8def\u5f84 --agree-tos\nEOF\nchmod +x \/root\/renew-ssl.sh\n<\/code><\/pre>\n<p>crontab\u91cc\u6dfb\u52a0\u4e0a\uff1a<code>0 5 *\/60 * * \/root\/renew-ssl.sh<\/code> \u6bcf60\u5929\u76845\u70b9\u66f4\u65b0\u4e00\u6b21\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5 Let\u2019s Encrypt \u5ba2\u6237\u7aef \u5148\u66f4\u65b0\u7cfb\u7edf\u548c\u5b89\u88c5 git\uff0c\u4e0b\u8f7d Let\u2019s Encrypt git  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1100","post","type-post","status-publish","format-standard","hentry","category-website"],"_links":{"self":[{"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts\/1100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1100"}],"version-history":[{"count":0,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts\/1100\/revisions"}],"wp:attachment":[{"href":"http:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1100"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}