﻿{"id":251,"date":"2018-10-09T09:24:44","date_gmt":"2018-10-09T01:24:44","guid":{"rendered":"http:\/\/www.cloudy.pub\/?p=251"},"modified":"2018-10-09T09:49:44","modified_gmt":"2018-10-09T01:49:44","slug":"apache-an-zhuang-ssl-zheng-shu","status":"publish","type":"post","link":"https:\/\/www.0moon.com\/?p=251","title":{"rendered":"Apache\u5b89\u88c5SSL\u8bc1\u4e66"},"content":{"rendered":"<ol>\n<li>\u521b\u5efa\u79c1\u94a5(\u53ef\u9009\uff0c\u7528\u4e8e\u7533\u8bf7\u8bc1\u4e66):<\/li>\n<\/ol>\n<div class=\"highlight highlight-source-shell\">\n<pre>openssl genrsa 2048 <span class=\"pl-k\">&gt;<\/span> private-key.pem<\/pre>\n<\/div>\n<ol start=\"2\">\n<li>\u521b\u5efa\u8bc1\u4e66\u7b7e\u540d (CSR\uff0c\u53ef\u9009):<\/li>\n<\/ol>\n<div class=\"highlight highlight-source-shell\">\n<pre>openssl req -new -key private-key.pem -out csr.pem<\/pre>\n<\/div>\n<ol start=\"3\">\n<li>\u4e0a\u4f20\u5230\u670d\u52a1\u5668:<\/li>\n<\/ol>\n<div class=\"highlight highlight-source-shell\">\n<pre>scp .\/STAR_yourdomain_com\/<span class=\"pl-k\">*<\/span> yourdomain:\/etc\/pki\/tls\/private\/<\/pre>\n<\/div>\n<ol start=\"4\">\n<li>\u5408\u5e76\u6b63\u89c4\u6e20\u9053\u83b7\u5f97\u7684\u8bc1\u4e66:<\/li>\n<\/ol>\n<div class=\"highlight highlight-source-shell\">\n<pre>cat STAR_yourdomain_com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt <span class=\"pl-k\">&gt;<\/span> ssl-bundle.crt<\/pre>\n<\/div>\n<ol start=\"5\">\n<li>\u914d\u7f6eApache\uff08\u4e0d\u518d\u7d2f\u8ff0\u8be6\u7ec6\u914d\u7f6e\u8fc7\u7a0b\uff09:<\/li>\n<\/ol>\n<div class=\"highlight highlight-source-shell\" data-find=\"_2\">\n<pre data-find=\"_1\"><span class=\"pl-k\">&lt;<\/span>VirtualHost <span class=\"pl-k\">*<\/span>:<span class=\"pl-k\">443&gt;<\/span>\r\n  ServerName <span class=\"pl-k\">*<\/span>.yourdomain.com\r\n  SSLEngine on\r\n\r\n  SSLCertificateFile \/etc\/pki\/tls\/private\/STAR_yourdomain_com.crt\r\n  SSLCertificateKeyFile \/etc\/pki\/tls\/private\/STAR_yourdomain_com.key\r\n  SSLCertificateChainFile \/etc\/pki\/tls\/private\/ssl-bundle.crt\r\n  SSLCACertificateFile \/etc\/pki\/tls\/private\/AddTrustExternalCARoot.crt\r\n<span class=\"pl-k\">&lt;<\/span>\/VirtualHost<span class=\"pl-k\">&gt;<\/span><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u521b\u5efa\u79c1\u94a5(\u53ef\u9009\uff0c\u7528\u4e8e\u7533\u8bf7\u8bc1\u4e66): openssl genrsa 2048 &gt; private-key.p [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[56,55],"class_list":["post-251","post","type-post","status-publish","format-standard","hentry","category-study","tag-apache","tag-ssl"],"_links":{"self":[{"href":"https:\/\/www.0moon.com\/index.php?rest_route=\/wp\/v2\/posts\/251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.0moon.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.0moon.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.0moon.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.0moon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=251"}],"version-history":[{"count":4,"href":"https:\/\/www.0moon.com\/index.php?rest_route=\/wp\/v2\/posts\/251\/revisions"}],"predecessor-version":[{"id":255,"href":"https:\/\/www.0moon.com\/index.php?rest_route=\/wp\/v2\/posts\/251\/revisions\/255"}],"wp:attachment":[{"href":"https:\/\/www.0moon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.0moon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.0moon.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}