{"id":7276,"date":"2021-06-30T14:16:32","date_gmt":"2021-06-30T06:16:32","guid":{"rendered":"https:\/\/www.5x44.cn\/?p=7276"},"modified":"2021-06-30T14:16:32","modified_gmt":"2021-06-30T06:16:32","slug":"%e9%85%8d%e7%bd%aeapache%e6%94%af%e6%8c%81https","status":"publish","type":"post","link":"https:\/\/www.5x44.cn\/?p=7276","title":{"rendered":"\u914d\u7f6eApache\u652f\u6301HTTPS"},"content":{"rendered":"\n<p>\u4e00\u3001\u9996\u5148\u7f16\u8bd1apache\u652f\u6301ssl\uff0c\u8981\u5b89\u88c5openssl\uff0c\u6211\u7528\u7684\u662fCentOs 8\uff0c\u5df2\u7ecf\u9ed8\u8ba4\u5b89\u88c5\u597d\u4e86openssl\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#! \/bin\/sh\n#\n# Created by configure\n\n\".\/configure\" \\\n\"--prefix=\/usr\/local\/apache2\" \\\n\"--with-included-apr\" \\\n\"--enable-so\" \\\n\"--enable-ssl\" \\\n\"--enable-socache-shmcb\" \\\n\"$@\"<\/code><\/pre>\n\n\n\n<p>\u4e8c\u3001\u7533\u8bf7\u8bc1\u4e66<\/p>\n\n\n\n<p>\u6211\u4f7f\u7528\u7684\u662fcertbot\u7533\u8bf7\u7684\u8bc1\u4e66\uff0c\u5176\u5b9e\u4ed6\u4eec\u7684\u8bc1\u4e66\u4e5f\u662f\u6ca1\u6709\u7ecf\u8fc7\u8ba4\u8bc1\u7684\uff0c\u9700\u8981\u8ba4\u8bc1\u7684\u8bc1\u4e66\u5c31\u5f97\u82b1\u94b1\u4e86\uff0c\u5176\u5b9e\u8fd9\u4e48\u770b\u6765\u4e5f\u53ef\u4ee5\u81ea\u5df1\u751f\u6210\u8bc1\u4e66\uff1a<\/p>\n\n\n\n<p>certbot\u53ea\u662f\u4e00\u4e2apython\u811a\u672c\u53ef\u4ee5\u81ea\u52a8\u5411\u5176\u8bc1\u4e66\u670d\u52a1\u5668\u7533\u8bf7\u8bc1\u4e66\u548c\u79c1\u94a5\uff0c\u56e0\u4e3a\u6211\u7684apache\u662f\u7f16\u8bd1\u5b89\u88c5\u7684\uff0ccertbot\u7684\u811a\u672c\u4e0d\u80fd\u81ea\u52a8\u5904\u7406\u6211\u7684\u914d\u7f6e\uff08\u8fd9\u662f\u4ed6\u4eec\u8bba\u575b\u4e0a\u4e00\u4f4d\u5927\u795e\u8bf4\u7684\uff09\uff0c\u4e8e\u662f\u6211\u53ea\u7533\u8bf7\u4e86\u8bc1\u4e66\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>certbot certonly<span class=\"has-inline-color has-vivid-red-color\"> --webroot -w \/usr\/local\/apache2\/htdocs\/www<\/span>\u7ea2\u8272\u90e8\u5206\u5199\u4e0d\u5199\u597d\u50cf\u90fd\u884c\uff0c\u56e0\u4e3a\u6211\u4e5f\u53ea\u662f\u7533\u8bf7\u4e86\u8bc1\u4e66\ncurl -k -v 'https:\/\/127.0.0.1\/www' #\u53ef\u4ee5\u901a\u8fc7\u8be5\u547d\u4ee4\u9a8c\u8bc1\u8bc1\u4e66\u662f\u5426\u5b89\u88c5\u6210\u529f\uff0c\u6211\u5c31\u906d\u9047\u4e86apache\u670d\u52a1\u5668\u7aef\u8bc1\u4e66\u914d\u7f6e\u9519\u8bef\uff0c\u5982\u679c\u6ca1\u6709\u95ee\u9898\uff0c\u8f93\u51fa\u4f1a\u6709\u4e00\u884c\u5199\u7740\u9a8c\u8bc1\u6210\u529f\u4e86\u3002\u6b64\u65f6\u53d1\u73b0\u4e86curl\u5b58\u5728\u7684\u5fc5\u8981\u6027\u3002<\/code><\/pre>\n\n\n\n<p>\u4e09\u3001\u7f16\u8f91Apache\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>LoadModule socache_shmcb_module modules\/mod_socache_shmcb.so\nLoadModule ssl_module        modules\/mod_ssl.so\nInclude conf\/extra\/httpd-ssl.conf<\/code><\/pre>\n\n\n\n<p>\u56db\u3001\u7f16\u8f91httpd-ssl.conf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Listen 443\nSSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES\nSSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES\nSSLHonorCipherOrder on \nSSLProtocol all -SSLv3\nSSLProxyProtocol all -SSLv3\nSSLPassPhraseDialog  builtin\nSSLSessionCache        \"shmcb:\/usr\/local\/apache2\/logs\/ssl_scache(512000)\"\nSSLSessionCacheTimeout  300\n&lt;VirtualHost _default_:443>\nDocumentRoot \"\/mnt\/www\"#\u865a\u62df\u4e3b\u673a\u7684\u6839\u76ee\u5f55\u8981\u914d\u7f6e\u6b63\u786e\uff0c\u4e0d\u7136\u65e0\u6cd5\u8bbf\u95ee\uff0c\u4f1a\u63d0\u793a\u6ca1\u6709\u6743\u9650\nServerName www.5x44.cn:443\nServerAdmin skiron_liu@163.com\nErrorLog \"\/usr\/local\/apache2\/logs\/error_log\"\nTransferLog \"\/usr\/local\/apache2\/logs\/access_log\"\nSSLEngine on\nSSLCertificateFile \"\/etc\/letsencrypt\/live\/5x44.cn\/fullchain.pem\"#\u6211\u4f7f\u7528\u7684\u662fcertbot\u7684\u8bc1\u4e66\u3002\nSSLCertificateKeyFile \"\/etc\/letsencrypt\/live\/5x44.cn\/privkey.pem\"\n&lt;FilesMatch \"\\.(cgi|shtml|phtml|php)$\">\r\n    SSLOptions +StdEnvVars\r\n&lt;\/FilesMatch>\r\n&lt;Directory \"\/usr\/local\/apache2\/cgi-bin\">\r\n    SSLOptions +StdEnvVars\r\n&lt;\/Directory>\nBrowserMatch \"MSIE &#91;2-5]\" \\\r\n         nokeepalive ssl-unclean-shutdown \\\r\n         downgrade-1.0 force-response-1.0\nCustomLog \"\/usr\/local\/apache2\/logs\/ssl_request_log\" \\\r\n          \"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \\\"%r\\\" %b\"\r\n\r\n&lt;\/VirtualHost>\r<\/code><\/pre>\n\n\n\n<p>\u4e94\u3001\u5927\u4f53\u4e0a\u8fd9\u5c31\u914d\u7f6e\u5b8c\u4e86\uff0c\u4e0d\u8fc7\u6700\u540e\u6211\u4e5f\u6ca1\u6709\u4f7f\u7528https\uff0c\u56e0\u4e3awordpress\u662f\u652f\u6301https\u7684\uff0c\u4f46\u662f\u4e3b\u9898\u4e0d\u652f\u6301\uff0c\u6211\u6309\u7f51\u4e0a\u8bf4\u7684\u4fee\u6539\u4e86\uff08\u4fee\u6539\u4e3b\u9898\u7684functions.php,\u6839\u76ee\u5f55\u7684wp_config.php,\u66f4\u65b0\u6570\u636e\u5e93\u7b49\u7b49\u64cd\u4f5c\uff09\uff0c\u4f46\u662f\u8fdb\u5165\u540e\u53f0\u7ba1\u7406\u9875\u9762\u8fd8\u662f\u5e03\u5c40\u9519\u4e71\uff0c\u6211\u53ea\u80fd\u518d\u4fee\u6539\u56dehttp\u7684\u65b9\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u9996\u5148\u7f16\u8bd1apache\u652f\u6301ssl\uff0c\u8981\u5b89\u88c5openssl\uff0c\u6211\u7528\u7684\u662fCentOs 8\uff0c\u5df2\u7ecf\u9ed8\u8ba4\u5b89\u88c5\u597d\u4e86openssl\uff1a \u4e8c\u3001\u7533\u8bf7\u8bc1\u4e66 \u6211\u4f7f\u7528\u7684\u662fcertbot\u7533\u8bf7&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.5x44.cn\/?p=7276\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-7276","post","type-post","status-publish","format-standard","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts\/7276","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7276"}],"version-history":[{"count":3,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts\/7276\/revisions"}],"predecessor-version":[{"id":7280,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts\/7276\/revisions\/7280"}],"wp:attachment":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}