{"id":3050,"date":"2019-04-10T16:25:00","date_gmt":"2019-04-10T08:25:00","guid":{"rendered":"https:\/\/www.webteach.tw\/?p=3050"},"modified":"2019-04-10T16:25:00","modified_gmt":"2019-04-10T08:25:00","slug":"%e8%87%aa%e7%b0%bd%e6%86%91%e8%ad%89","status":"publish","type":"post","link":"https:\/\/www.webteach.tw\/?p=3050","title":{"rendered":"[ SSL ] &#8211; Apache SSL \u81ea\u7c3d\u6191\u8b49"},"content":{"rendered":"\n\t\t\t\t\n<p class=\"wp-block-paragraph\">\u6703\u6709\u9019\u7a2e\u9700\u6c42\u662f\u56e0\u70ba\u8cfc\u8cb7\u6191\u8b49\u9700\u8981\u7c3d\u55ae\uff0cVM\u56e0\u5b89\u5168\u56e0\u7d20\u53ea\u958b443port\u6240\u4ee5\u53ea\u80fd\u8b8a\u901a\u4e00\u4e0b\u7528 \u81ea\u7c3d\u6191\u8b49 \u4f86\u89e3\u6c7a\u9019\u500b\u554f\u984c\uff0c\u4f46\u9019\u6a23\u505a\u4e5f\u662f\u6709\u597d\u8655\u7684\uff0c\u6b63\u5f0f\u6191\u8b49\u4e0b\u4f86\u5f8c\u76f4\u63a5\u63dbCRT\u6a94\uff0c\u5c31\u53ef\u4ee5\u5feb\u901f\u8d77\u7528\u65b0\u6191\u8b49\u3002<\/p>\n\n\n<p class=\"wp-block-paragraph\">\u555f\u7528 apache ssl \u6a21\u7d44<br \/>\n\u6307\u4ee4\uff1asudo a2enmod ssl<\/p>\n\n\n<p class=\"wp-block-paragraph\">\u767c\u884c\u81ea\u7c3d\u6191\u8b49<br \/>\n\u6307\u4ee4\uff1aopenssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \/home\/jeff\/apache.key -out \/home\/jeff\/apache.crt<br \/>\n\u6307\u4ee4\u8aaa\u660e \u7522\u751f\u6191\u8b49 key \u8207 crt \u6709\u6548\u671f\u9650\u70ba 365\u5929 \u4f7f\u7528 2048\u4f4d\u5143 rsa\u52a0\u5bc6<\/p>\n\n\n<p class=\"wp-block-paragraph\">\u4e0b\u5b8c\u6307\u4ee4\u5f8c\u8f38\u5165\u76f8\u95dc\u8cc7\u8a0a<br \/>\nCountry Name (2 letter code) [AU]:TW                                   \/\/\u570b\u5bb6\u7c21\u78bc TW<br \/>\nState or Province Name (full name) [Some-State]:Taiwan                 \/\/\u5b8c\u6574\u570b\u5bb6\u540d\u7a31<br \/>\nLocality Name (eg, city) []:New Taipei                                 \/\/\u57ce\u5e02\u540d\u7a31<br \/>\nOrganization Name (eg, company) [Internet Widgits Pty Ltd]:Webteach    \/\/\u7d44\u7e54\uff08\u516c\u53f8\uff09\u540d\u7a31<br \/>\nOrganizational Unit Name (eg, section) []:IT                           \/\/\u55ae\u4f4d\uff08\u90e8\u9580\uff09\u540d\u7a31<br \/>\nCommon Name (e.g. server FQDN or YOUR name) []:www.webteach.tw         \/\/\u6191\u8b49\u540d\u7a31 \u5efa\u8b70\u586b\u7db2\u5740\uff08\u6709\u53ef\u80fd\u540c\u4e3b\u6a5f\u591a\u500bssl\uff09<br \/>\nEmail Address []:test@gmail.com.tw                                     \/\/\u806f\u7d61Email\u8acb\u586b\u771f\u7684\u53ef\u901a\u8a0a\u7684Email<br \/>\n\u4f46\u56e0\u70ba\u662f\u81ea\u7c3d\u6191\u8b49\u7684\u95dc\u4fc2\uff0c\u4e0a\u9762\u7684\u96a8\u4fbf\u586b\u4e5f\u4e0d\u6703\u600e\u6a23&gt;&lt;<\/p>\n\n\n<p class=\"wp-block-paragraph\">\u4fee\u6539 apache ssl \u8a2d\u5b9a<br \/>\n\u6307\u4ee4\uff1asudo vi \/etc\/apache2\/sites-available\/default-ssl.conf<\/p>\n\n\n<p class=\"wp-block-paragraph\">\u4fee\u6539\u8a2d\u5b9a\u6a94\u4e2d\u7684\u9019\u5169\u884c<br \/>\nSSLCertificateFile \/home\/jeff\/apache.crt<\/p>\n\n\n<p class=\"wp-block-paragraph\">SSLCertificateKeyFile \/home\/jeff\/apache.key<\/p>\n\n\n<p class=\"wp-block-paragraph\">\u555f\u7528 apache ssl \u8a2d\u5b9a<br \/>\n\u6307\u4ee4\uff1asudo a2ensite default-ssl.conf<\/p>\n\n\n<p class=\"wp-block-paragraph\">\u91cd\u555fapache<br \/>\n\u6307\u4ee4\uff1asudo service apache2 restart<\/p>\n\n\n<p class=\"wp-block-paragraph\">\u6700\u5f8c\u958b\u555f\u700f\u89bd\u5668 \u8f38\u5165\uff0chttps:\/\/\u4f60\u7684\u7db2\u5740<br \/>\n\u4f46\u7531\u65bc\u4f60\u7684\u4e3b\u6a5f\u975e\u53ef\u4fe1\u8a8d\u7684\u7b2c\u4e09\u65b9\u767c\u8b49\u6a5f\u69cb\u6240\u4ee5 \u6703\u51fa\u73fe \u4f60\u7684\u9023\u63a5\u4e0d\u662f\u79c1\u4eba\u7684\uff08Your connection is not private\uff09<br \/>\nThis server could not prove that it is yourweburl; its security certificate is not trusted by your computer&#8217;s operating system. This may be caused by a misconfiguration or an attacker intercepting your connection.<\/p>\n\n\n<p class=\"wp-block-paragraph\">Proceed to yourweburl (unsafe)&lt;=\u5c31\u9ede\u9019\u500b\u5427<\/p>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\t\t\t\t\u6703\u6709\u9019\u7a2e\u9700\u6c42\u662f\u56e0\u70ba\u8cfc\u8cb7\u6191\u8b49\u9700\u8981\u7c3d\u55ae\uff0cVM\u56e0\u5b89\u5168\u56e0\u7d20\u53ea\u958b443port\u6240\u4ee5\u53ea\u80fd\u8b8a\u901a\u4e00\u4e0b\u7528 \u81ea\u7c3d\u6191\u8b49 \u4f86\u89e3\u6c7a\u9019\u500b\u554f\u984c\uff0c\u4f46\u9019\u6a23\u505a\u4e5f\u662f\u6709\u597d\u8655\u7684\uff0c\u6b63\u5f0f\u6191\u8b49\u4e0b\u4f86\u5f8c\u76f4\u63a5\u63dbCRT\u6a94\uff0c\u5c31\u53ef\u4ee5\u5feb\u901f\u8d77\u7528\u65b0\u6191\u8b49\u3002\t\t<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[527,1135],"class_list":["post-3050","post","type-post","status-publish","format-standard","hentry","category-linux","tag-ssl","tag-1135"],"_links":{"self":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/3050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3050"}],"version-history":[{"count":0,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/3050\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}