﻿{"id":606,"date":"2018-09-30T23:22:19","date_gmt":"2018-09-30T15:22:19","guid":{"rendered":"https:\/\/www.chenweikang.top\/?p=606"},"modified":"2018-09-30T23:22:19","modified_gmt":"2018-09-30T15:22:19","slug":"%e8%a7%a3%e5%86%b3letsencrypt%e8%af%81%e4%b9%a6%e5%88%b0%e6%9c%9f%ef%bc%8c%e6%97%a0%e6%b3%95%e7%bb%ad%e6%9c%9f%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.chenweikang.top\/?p=606","title":{"rendered":"\u89e3\u51b3letsencrypt\u8bc1\u4e66\u5230\u671f\uff0c\u65e0\u6cd5\u7eed\u671f\u7684\u95ee\u9898"},"content":{"rendered":"<p>\u7531\u4e8eletsencrypt\u8bc1\u4e66\u5230\u671f\uff0c\u5bfc\u81f4\u535a\u5ba2\u65e0\u6cd5\u8bbf\u95ee\uff0c\u597d\u4e00\u901a\u6298\u817e\uff0c\u7ec8\u4e8e\u8df3\u51fa\u5751\uff01<\/p>\n<h2>\u4e0b\u8f7d\u6700\u65b0\u7684Letsencrypt:<\/h2>\n<blockquote><p>git clone\u00a0https:\/\/github.com\/certbot\/certbot.git<\/p><\/blockquote>\n<h3>\u5f00\u59cb\u5b89\u88c5\u8bc1\u4e66<\/h3>\n<blockquote><p>.\/letsencrypt-auto<\/p><\/blockquote>\n<h3>\u65e0\u5948python\u51b2\u7a81\u62a5\u9519\uff1a<\/h3>\n<blockquote><p>[root@iz2zeeuc8ed3wflgmb7rakz letsencrypt]# .\/letsencrypt-auto<br \/>\nBootstrapping dependencies for RedHat-based OSes... (you can skip this with --no-bootstrap)<br \/>\nyum is \/usr\/bin\/yum<br \/>\nyum is hashed (\/usr\/bin\/yum)<br \/>\nLoaded plugins: fastestmirror<br \/>\nRepository base is listed more than once in the configuration<br \/>\nRepository updates is listed more than once in the configuration<br \/>\nRepository extras is listed more than once in the configuration<br \/>\nRepository epel is listed more than once in the configuration<br \/>\nLoading mirror speeds from cached hostfile<br \/>\n* webtatic: uk.repo.webtatic.com<br \/>\nPackage gcc-4.8.5-28.el7_5.1.x86_64 already installed and latest version<br \/>\nPackage augeas-libs-1.4.0-5.el7_5.1.x86_64 already installed and latest version<br \/>\nPackage 1:openssl-1.0.2k-12.el7.x86_64 already installed and latest version<br \/>\nPackage 1:openssl-devel-1.0.2k-12.el7.x86_64 already installed and latest version<br \/>\nPackage libffi-devel-3.0.13-18.el7.x86_64 already installed and latest version<br \/>\nPackage redhat-rpm-config-9.1.0-80.el7.centos.noarch already installed and latest version<br \/>\nPackage ca-certificates-2018.2.22-70.0.el7_5.noarch already installed and latest version<br \/>\nPackage python-devel-2.7.5-69.el7_5.x86_64 already installed and latest version<br \/>\nPackage python-virtualenv-15.1.0-2.el7.noarch already installed and latest version<br \/>\nPackage python-tools-2.7.5-69.el7_5.x86_64 already installed and latest version<br \/>\nPackage python2-pip-8.1.2-6.el7.noarch already installed and latest version<br \/>\nPackage 1:mod_ssl-2.4.6-80.el7.centos.1.x86_64 already installed and latest version<br \/>\nNothing to do<br \/>\nCreating virtual environment...<br \/>\n.\/letsencrypt-auto: line 975: virtualenv: command not found<\/p><\/blockquote>\n<p>\u770b\u4e86\u4e0b\u7cfb\u7edf\u91cc\u6ca1\u627e\u5230<\/p>\n<blockquote><p>[root@iz2zeeuc8ed3wflgmb7rakz letsencrypt]# virt<br \/>\nvirtualenv-2 virtualenv-2.7 virtualenv-3 virtualenv-3.4 virt-what virt-what-cpuid-helper<\/p><\/blockquote>\n<p><span style=\"color: #800000;\">\u4e8e\u662f\u7f16\u8f91\u00a0.\/letsencrypt-auto: line 975 \u628a\u00a0virtualenv \u6539\u4e3a\u00a0virtualenv-3\uff0c\u91cd\u65b0\u6267\u884c<\/span><\/p>\n<h3>\u4e2d\u9014\u6309\u63d0\u793a\u9009\u62e9\u9700\u8981\u52a0\u8bc1\u4e66\u7684\u914d\u7f6e<\/h3>\n<blockquote><p>How would you like to authenticate and install certificates?\uff08\u8fd9\u91cc\u6211\u7528nginx\u9009\u62e92\uff09<br \/>\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br \/>\n1: Apache Web Server plugin - Beta (apache)<br \/>\n2: Nginx Web Server plugin (nginx) [Misconfigured]<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<h3>\u586b\u5199\u90ae\u4ef6\u4fe1\u606f\uff0c\u7528\u4e8e\u63a5\u6536\u4fe1\u606f<\/h3>\n<blockquote><p>Enter email address (used for urgent renewal and security notices) (Enter 'c' to<br \/>\ncancel): chenwk.top@foxmail.com<\/p>\n<p>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<\/p><\/blockquote>\n<h3>\u540c\u610f\u534f\u8bae<\/h3>\n<blockquote><p>Please read the Terms of Service at<br \/>\nhttps:\/\/letsencrypt.org\/documents\/LE-SA-v1.2-November-15-2017.pdf. You must<br \/>\nagree in order to register with the ACME server at<br \/>\nhttps:\/\/acme-v02.api.letsencrypt.org\/directory<br \/>\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br \/>\n(A)gree\/(C)ancel: A<\/p>\n<p>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br \/>\nWould you be willing to share your email address with the Electronic Frontier<br \/>\nFoundation, a founding partner of the Let's Encrypt project and the non-profit<br \/>\norganization that develops Certbot? We'd like to send you email about our work<br \/>\nencrypting the web, EFF news, campaigns, and ways to support digital freedom.<br \/>\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br \/>\n(Y)es\/(N)o: Y<\/p><\/blockquote>\n<h3>\u9009\u62e9\u4f60\u8981\u52a0\u8bc1\u4e66\u7684\u57df\u540d\uff08\u8fd9\u91cc\u9009\u4e86\u4e4b\u540e\u4f1a\u81ea\u52a8\u5e2e\u4f60\u914d\u7f6enginx\uff09<\/h3>\n<blockquote><p>Which names would you like to activate HTTPS for?<br \/>\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br \/>\n1: aria.92kk.top<br \/>\n2: callname.92kk.top<br \/>\n3: dubbo.92kk.top<br \/>\n4: exam.92kk.top<br \/>\n5: lingdong.92kk.top<br \/>\n6: lovewall.92kk.top<br \/>\n7: mopi.92kk.top<br \/>\n8: opi.92kk.top<br \/>\n9: scms.92kk.top<br \/>\n10: ssm.92kk.top<br \/>\n11: web.92kk.top<br \/>\n12: chenweikang.top<br \/>\n13: cv.chenweikang.top<br \/>\n14: www.chenweikang.top<br \/>\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br \/>\nSelect the appropriate numbers separated by commas and\/or spaces, or leave input<br \/>\nblank to select all options shown (Enter 'c' to cancel): 14<br \/>\nObtaining a new certificate<br \/>\nPerforming the following challenges:<br \/>\nhttp-01 challenge for www.chenweikang.top<\/p><\/blockquote>\n<h2><span style=\"color: #800000;\">\u6574\u4e2a\u8fc7\u7a0b\u53ef\u80fd\u4f1a\u62a5\u9519\uff1a<\/span><\/h2>\n<blockquote><p>self.configurator.save(\"HTTP Challenge\", True)<br \/>\nFile \"\/opt\/eff.org\/certbot\/venv\/lib\/python2.7\/site-packages\/certbot_nginx\/configurator.py\", line 976, in save<br \/>\nself.parser.filedump(ext='')<br \/>\nFile \"\/opt\/eff.org\/certbot\/venv\/lib\/python2.7\/site-packages\/certbot_nginx\/parser.py\", line 243, in filedump<br \/>\nout = nginxparser.dumps(tree)<br \/>\nFile \"\/opt\/eff.org\/certbot\/venv\/lib\/python2.7\/site-packages\/certbot_nginx\/nginxparser.py\", line 134, in dumps<br \/>\nreturn str(RawNginxDumper(blocks.spaced))<br \/>\nFile \"\/opt\/eff.org\/certbot\/venv\/lib\/python2.7\/site-packages\/certbot_nginx\/nginxparser.py\", line 98, in __str__<br \/>\nreturn ''.join(self)<br \/>\nUnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 1: ordinal not in range(128)<\/p><\/blockquote>\n<h3><span style=\"color: #800000;\">\u7f16\u8f91\u00a0\/opt\/eff.org\/certbot\/venv\/lib\/python2.7\/site-packages\/certbot_nginx\/nginxparser.py \u5728\u6587\u4ef6\u5f00\u59cb\u52a0\u5165<\/span><\/h3>\n<blockquote><p>import sys<\/p>\n<p>reload(sys)<\/p>\n<p>sys.setdefaultencoding('utf8)<\/p><\/blockquote>\n<p>\u91cd\u65b0\u6267\u884c\u5373\u53ef\uff01<\/p>\n<h2>\u5c0f\u7eff\u9501\u7ec8\u4e8e\u56de\u6765\u5566<\/h2>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.chenweikang.top\/wp-content\/uploads\/2018\/09\/letsencrypt.png\" class=\"gallery_colorbox\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-607\" src=\"https:\/\/www.chenweikang.top\/wp-content\/uploads\/2018\/09\/letsencrypt-1024x678.png\"  alt=\"\" width=\"1024\" height=\"678\" srcset=\"https:\/\/www.chenweikang.top\/wp-content\/uploads\/2018\/09\/letsencrypt-1024x678.png 1024w, https:\/\/www.chenweikang.top\/wp-content\/uploads\/2018\/09\/letsencrypt-300x199.png 300w, https:\/\/www.chenweikang.top\/wp-content\/uploads\/2018\/09\/letsencrypt-768x508.png 768w, https:\/\/www.chenweikang.top\/wp-content\/uploads\/2018\/09\/letsencrypt.png 1336w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"https:\/\/www.chenweikang.top\">\u5de6\u624b\u4ee3\u7801\u53f3\u624b\u8bd7<\/a> &raquo; <a href=\"https:\/\/www.chenweikang.top\/?p=606\">\u89e3\u51b3letsencrypt\u8bc1\u4e66\u5230\u671f\uff0c\u65e0\u6cd5\u7eed\u671f\u7684\u95ee\u9898<\/a><\/p><div class=\"__youshang\">\r\n            <div id=\"__youshang_popup\" class=\"wechat popup\" style=\"display: none;\">\r\n                <div class=\"head\">~\u8c22\u8c22\u6253\u8d4f~<\/div>\r\n                <div class=\"qrcode\"><div class=\"qrcode-li wechat\" ><img src=\"https:\/\/www.chenweikang.top\/wp-content\/uploads\/2019\/07\/wexin.png\" \/><\/div><div class=\"qrcode-li alipay\" style=\"display:none;\"><img src=\"https:\/\/www.chenweikang.top\/wp-content\/uploads\/2019\/07\/ali-pay.png\" \/><\/div><div class=\"qrcode-li hongbao\" style=\"display:none;\"><img src=\"https:\/\/www.chenweikang.top\/wp-content\/uploads\/2019\/07\/ali-hongbao.png\" \/><\/div><\/div>\r\n                <ul class=\"platform\"><li class=\"icon-wechat active\" data-bg-color=\"#05af4e\" data-thanks=\"~\u8c22\u8c22\u6253\u8d4f~\"><\/li><li class=\"icon-alipay \" data-bg-color=\"#00a2ea\" data-thanks=\"~\u8c22\u8c22\u6253\u8d4f~\"><\/li><li class=\"icon-hongbao \" data-bg-color=\"#dd5746\" data-thanks=\"<p>\u626b\u7801\u9886\u7ea2\u5305<\/p><p style='margin-top: 24px;'>\uff08\u4f59\u989d\u5b9d\u652f\u4ed8\u65f6\u53ef\u62b5\u73b0\uff09<\/p>\"><\/li><\/ul>\r\n            <\/div>\r\n            <a href=\"javascript:void(0);\" id=\"__youshang_btn\">\u8d4f<\/a>\r\n        <\/div>","protected":false},"excerpt":{"rendered":"<p>\u7531\u4e8eletsencrypt\u8bc1\u4e66\u5230\u671f\uff0c\u5bfc\u81f4\u535a\u5ba2\u65e0\u6cd5\u8bbf\u95ee\uff0c\u597d\u4e00\u901a\u6298\u817e\uff0c\u7ec8\u4e8e\u8df3\u51fa\u5751\uff01 \u4e0b\u8f7d\u6700\u65b0\u7684Letsencryp [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":607,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"class_list":["post-606","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website"],"_links":{"self":[{"href":"https:\/\/www.chenweikang.top\/index.php?rest_route=\/wp\/v2\/posts\/606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chenweikang.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chenweikang.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chenweikang.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chenweikang.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=606"}],"version-history":[{"count":0,"href":"https:\/\/www.chenweikang.top\/index.php?rest_route=\/wp\/v2\/posts\/606\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.chenweikang.top\/index.php?rest_route=\/wp\/v2\/media\/607"}],"wp:attachment":[{"href":"https:\/\/www.chenweikang.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chenweikang.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chenweikang.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}