{"id":430,"date":"2024-04-30T17:28:22","date_gmt":"2024-04-30T09:28:22","guid":{"rendered":"https:\/\/turbostudio.xyz\/?p=430"},"modified":"2024-04-30T17:32:09","modified_gmt":"2024-04-30T09:32:09","slug":"%e4%bd%bf%e7%94%a8acme-sh%e8%87%aa%e5%8a%a8%e6%9b%b4%e6%96%b0ssl%e8%af%81%e4%b9%a6","status":"publish","type":"post","link":"https:\/\/turbostudio.xyz\/?p=430","title":{"rendered":"\u4f7f\u7528Acme.sh\u81ea\u52a8\u66f4\u65b0SSL\u8bc1\u4e66"},"content":{"rendered":"\n<p>\u4eca\u5e74\u6765\u963f\u91cc\u4e91\u66f4\u65b0\u4e86\u514d\u8d39\u57df\u540d\u7b56\u7565\uff0c\u539f\u672c\u514d\u8d391\u5e74\u7684SSL\u8bc1\u4e66\u6ca1\u6709\u4e86\uff0c\u8bf4\u662f\u56e0\u4e3a\u4f9b\u5e94\u5546\u539f\u56e0\uff0c\u73b0\u5728\u53ea\u80fd\u63d0\u4f9b3\u4e2a\u6708\u6709\u6548\u671f\u7684\u7248\u672c\uff0c\u800c\u539f\u672c1\u5e74\u514d\u8d39\u7684\u7248\u672c&#8230;\u8981\u52a0\u94b1\uff01<\/p>\n\n\n\n<p>\u4f5c\u4e3a\u4e00\u4e2a\u8d44\u6df1\u7f8a\u6bdb\u515a\uff0c\u679c\u65ad\u4e0d\u80fd\u60ef\u7740\u4ed6\uff0c\u6240\u4ee5\u95f2\u6765\u7f51\u4e0a\u7814\u7a76\u4e86\u4e00\u4e0b\uff0c\u51c6\u5907\u641e\u4e0a\u4e00\u4e2a\u81ea\u52a8\u7533\u8bf7\u5e76\u66f4\u65b0SSL\u7684\u65b9\u5f0f\uff0c\u8ba9\u7a0b\u5e8f\u6bcf\u9694\u4e00\u6bb5\u65f6\u95f4\u81ea\u52a8\u83b7\u53d6\u5e76\u540c\u6b65\u66f4\u65b0SSL\u8bc1\u4e66\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u63d0\u4f9b\u4e00\u4e0bAcme.sh\u7684<a href=\"https:\/\/github.com\/acmesh-official\/acme.sh\">\u4e3b\u9875\u5730\u5740<\/a>\uff0c\u8981\u611f\u8c22\u4f5c\u8005\u5236\u4f5c\u4e86\u8fd9\u4e48\u597d\u7528\u7684\u5de5\u5177\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"366\" src=\"https:\/\/i0.wp.com\/turbostudio.xyz\/wp-content\/uploads\/2024\/04\/PixPin_2024-04-30_17-25-39-1.png?fit=680%2C366&amp;ssl=1\" alt=\"\" class=\"wp-image-435\" srcset=\"https:\/\/i0.wp.com\/turbostudio.xyz\/wp-content\/uploads\/2024\/04\/PixPin_2024-04-30_17-25-39-1.png?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/turbostudio.xyz\/wp-content\/uploads\/2024\/04\/PixPin_2024-04-30_17-25-39-1.png?resize=300%2C161&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/figure>\n\n\n\n<p>Linux\u7cfb\u7edf\u4e0b\uff0c\u4e07\u7269\u4e4b\u59cb\u5fc5\u662f\u66f4\u65b0\u7cfb\u7edf apt update\uff0c\u66f4\u65b0\u5b8c\u4ee5\u540e\u5b89\u88c5acme.sh\u811a\u672c\uff0c\u5982\u679c\u4f60\u6ca1\u6709curl\u53ef\u4ee5\u4f7f\u7528get\u6216\u8005apt\u5b89\u88c5\u4e00\u4e2a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Shell\u547d\u4ee4: curl https:\/\/get.acme.sh <\/code><\/pre>\n\n\n\n<p>\u811a\u672c\u5b89\u88c5\u5e76\u6267\u884c\u5b8c\u4ee5\u540e\u4f1a\u81ea\u52a8\u5e2e\u4f60alias\u4e00\u4e2aacme.sh\u7684\u547d\u4ee4\uff0c\u5b89\u88c5\u5b8c\u6210\u540e\u8981\u91cd\u65b0\u52a0\u8f7d\u4e00\u4e0b<code>.bashrc<\/code>\u6587\u4ef6\uff1a<code>source ~\/.bashrc<\/code>\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7acme.sh -h\u6765\u786e\u8ba4\u662f\u5426\u5df2\u5b89\u88c5\u597d\u3002<\/p>\n\n\n\n<p><strong>\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u7533\u8bf7\u4f60\u7684\u8bc1\u4e66:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>acme.sh --issue -d xxxxx.com --nginx #niginx\u670d\u52a1\u5668\u7248\u672c\uff0capache\u670d\u52a1\u5668\u8bf7\u5bf9\u5e94\u4fee\u6539<\/code><\/pre>\n\n\n\n<p><strong>\u6216\u8005\u4f7f\u7528dns\u65b9\u6cd5\u4e00\u52b3\u6c38\u9038\uff1a<\/strong><br>\u5728\u963f\u91cc\u4e91\u6216\u4f60\u7684\u57df\u540d\u89e3\u6790\u4f9b\u5e94\u5546\u5e73\u53f0\u7533\u8bf7APIKEY\uff1a<br>\u5728~\/.acme.sh\/\u4e2d\u6253\u5f00acme.sh.env\u6587\u4ef6\uff0c\u5728\u4e0b\u9762\u5185\u5bb9\u540e\u6dfb\u52a0\u4f60\u5728\u4f9b\u5e94\u5546\u5e73\u53f0\u7533\u8bf7\u5230\u7684APIkey\u548cSecret<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export LE_WORKING_DIR=\"\/root\/.acme.sh\"\nalias acme.sh=\"\/root\/.acme.sh\/acme.sh\"<\/code><\/pre>\n\n\n\n<p>\u8f93\u5165\u4f60\u7684key\u548c\u5bc6\u94a5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export Ali_Key=\"************\"\nexport Ali_Secret=\"************\"<\/code><\/pre>\n\n\n\n<p>\u540e\u7eed\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4\u76f4\u63a5\u66f4\u65b0\uff0c\u4e0d\u9700\u8981\u518d\u6307\u5b9a\u76f8\u5173\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>acme.sh --issue -d xxxxxx.com --dns  dns_dp<\/code><\/pre>\n\n\n\n<p>\u9ed8\u8ba4\u751f\u6210\u7684\u8bc1\u4e66\u90fd\u653e\u5728\u5b89\u88c5\u76ee\u5f55\u4e0b:\u00a0<code>~\/.acme.sh\/<\/code>\uff0c\u4f46\u662f\u4e0d\u8981\u76f4\u63a5\u4f7f\u7528\u6b64\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u3002\u53ef\u4ee5\u4f7f\u7528<code>--install-cert<\/code>\u547d\u4ee4\u81ea\u52a8\u5b8c\u6210\u8bc1\u4e66\u590d\u5236\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>acme.sh --install-cert -d example.com \\\n--key-file       \/path\/to\/keyfile\/in\/nginx\/key.pem  \\\n--fullchain-file \/path\/to\/fullchain\/nginx\/cert.pem \\\n--reloadcmd     \"service nginx force-reload\"<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u4e00\u5207\u770b\u8d77\u6765\u90fd\u8fd0\u884c\u6b63\u5e38\uff0c\u90a3\u4e48\u4f60\u7684\u8bc1\u4e66\u5c06\u4f1a\u5728\u7ea660d\u5de6\u53f3\u81ea\u52a8\u66f4\u65b0\u4e00\u6b21\u3002\u4e0d\u9700\u8981\u6211\u4eec\u518d\u8fdb\u884c\u5e72\u9884\u3002<\/p>\n\n\n\n<p>\u8f85\u52a9\u53c2\u8003\u8d44\u6599:<a href=\"https:\/\/github.com\/acmesh-official\/acme.sh\/wiki\/%E8%AF%B4%E6%98%8E\">https:\/\/github.com\/acmesh-official\/acme.sh\/wiki\/%E8%AF%B4%E6%98%8E<\/a>(\u4e2d\u6587)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5e74\u6765\u963f\u91cc\u4e91\u66f4\u65b0\u4e86\u514d\u8d39\u57df\u540d\u7b56\u7565\uff0c\u539f\u672c\u514d\u8d391\u5e74\u7684SSL\u8bc1\u4e66\u6ca1\u6709\u4e86\uff0c\u8bf4\u662f\u56e0\u4e3a\u4f9b\u5e94\u5546\u539f\u56e0\uff0c\u73b0\u5728\u53ea\u80fd\u63d0\u4f9b3\u4e2a\u6708\u6709\u6548\u671f\u7684 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":436,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[56],"tags":[55,53,54,52],"class_list":["post-430","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website","tag-acme-sh","tag-ssl","tag-54","tag-52"],"blocksy_meta":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/turbostudio.xyz\/wp-content\/uploads\/2024\/04\/ACME%E2%80%93protocol-icon.png?fit=252%2C252&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/turbostudio.xyz\/index.php?rest_route=\/wp\/v2\/posts\/430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/turbostudio.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/turbostudio.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/turbostudio.xyz\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/turbostudio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=430"}],"version-history":[{"count":4,"href":"https:\/\/turbostudio.xyz\/index.php?rest_route=\/wp\/v2\/posts\/430\/revisions"}],"predecessor-version":[{"id":437,"href":"https:\/\/turbostudio.xyz\/index.php?rest_route=\/wp\/v2\/posts\/430\/revisions\/437"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/turbostudio.xyz\/index.php?rest_route=\/wp\/v2\/media\/436"}],"wp:attachment":[{"href":"https:\/\/turbostudio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/turbostudio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/turbostudio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}