{"id":1780,"date":"2018-09-23T10:23:02","date_gmt":"2018-09-23T01:23:02","guid":{"rendered":"http:\/\/helloidea.org\/?p=1780"},"modified":"2019-06-09T21:05:09","modified_gmt":"2019-06-09T12:05:09","slug":"%e3%82%b5%e3%82%a4%e3%83%88%e3%82%92https%e5%8c%96%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/helloidea.org\/index.php\/archives\/1780.html","title":{"rendered":"\u30b5\u30a4\u30c8\u3092https\u5316\u3057\u3066\u307f\u308b"},"content":{"rendered":"<p>\u7d50\u69cb\u524d\u304b\u3089Google\u304c\u672c\u6c17\u3067https\u5316\u3092\u4fc3\u3057\u3066\u3044\u3066\u3001\u6c17\u306b\u306f\u3057\u3066\u3044\u305f\u3082\u306e\u306e\u7d50\u5c40\u653e\u7f6e\u3057\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u6c17\u304c\u5411\u3044\u305f\u306e\u3067https\u5316\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u25a0\u74b0\u5883<br>Apache2 &#8211; 2.4.25-3+deb9u5<br>Debian\u30d1\u30c3\u30b1\u30fc\u30b8\u306eApache2\u306b\u306a\u308a\u307e\u3059<\/p>\n<p>\u25a0\u69cb\u7bc9<br><strong>1. Apache2\u306essl\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u6709\u52b9\u5316\u3059\u308b<\/strong><\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3001ssl\u30e2\u30b8\u30e5\u30fc\u30eb\u3068ssl\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u3092\u6709\u52b9\u5316\u3057\u307e\u3059<\/p>\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# ssl\u30e2\u30b8\u30e5\u30fc\u30eb\u6709\u52b9\u5316\n$ a2enmod ssl\n# ssl\u30b5\u30a4\u30c8\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u6709\u52b9\u5316\n$ a2ensite default-ssl\n# apache2\u518d\u8d77\u52d5\n$ systemctl restart apache2\n<\/pre><\/pre>\n<p>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001<br>mods-available\u3078\u306e\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u304cmods-enabled\u306b\u7f6e\u304b\u308c<br>sites-available\u3078\u306e\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u304csites-enabled\u306b\u7f6e\u304b\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059<br>\u624b\u4f5c\u696d\u3067\u666e\u901a\u306b\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3092\u4f5c\u6210\u3057\u3066\u3082\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br>\u518d\u8d77\u52d5\u3082\u666e\u901a\u306b \/etc\/init.d\/apache2 restart \u3068\u3057\u3066\u3082\u826f\u3044\u3067\u3059\u3002<\/p>\n<pre><pre class=\"brush: plain; highlight: [6,7,9,10,13,16]; title: ; notranslate\" title=\"\">\netc\n+apache2\n|+conf-available\n|+conf-enabled\n|+mods-available\n||+ssl.conf\n||+ssl.load\n|+mods-enabled\n||+ssl.conf\n||+ssl.load\n|+sites-available\n||+000-default.conf\n||\\default-ssl.conf\n|+sites-enabled\n||+000-default.conf\n||\\default-ssl.conf\n|+apache2.conf\n|+apache2.conf.dpkg-dist\n|+envvars\n|+magic\n|\\ports.conf\n<\/pre><\/pre>\n<p>\u3053\u308c\u3060\u3051\u3067Apache2\u306f443\u30dd\u30fc\u30c8\u3067\u5f85\u3061\u53d7\u3051\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ ss -ltn | grep 443\nLISTEN     0      128         :::443                     :::*\n<\/pre><\/pre>\n<p>\u203b443\u30dd\u30fc\u30c8\u30a2\u30af\u30bb\u30b9\u306f80\u30dd\u30fc\u30c8\u3068\u306f\u5225\u306eVirtualHost\u3068\u306a\u308b\u305f\u3081DocumentRoot\u306e\u8a2d\u5b9a\u306a\u3069\u63c3\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><strong>2. \u8a3c\u660e\u66f8\u306e\u8a2d\u5b9a<\/strong><br>apache2\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u6700\u521d\u304b\u3089\u81ea\u5df1\u8a3c\u660e\u66f8\u304c\u751f\u6210\u3055\u308c\u3066\u304a\u308a\u3001<br>\u30c7\u30d5\u30a9\u30eb\u30c8\u306essl\u8a2d\u5b9a(default-ssl.conf)\u304b\u3089\u3082\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u7279\u306b\u4f55\u3082\u3057\u306a\u304f\u3066\u3082\u52d5\u304d\u306f\u3057\u307e\u3059\u3002<br>SSLCertificateFile\u3068SSLCertificateKeyFile\u304b\u3089\u53c2\u7167\u3057\u3066\u307e\u3059<\/p>\n<p>ssl\u7528\u306e\u516c\u958b\u9375\u3068\u79d8\u5bc6\u9375\u306f\u4ee5\u4e0b\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u65e2\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<pre><pre class=\"brush: plain; highlight: [4,6]; title: ; notranslate\" title=\"\">\netc\n+ssl\n|+certs\n||+ssl-cert-snakeoil.pem\n|+private\n||\\ssl-cert-snakeoil.key\n|\\openssl.cnf\n<\/pre><\/pre>\n<p>\u3053\u306e\u6bb5\u968e\u3067\u3059\u3067\u306bhttps\u30a2\u30af\u30bb\u30b9\u51fa\u6765\u307e\u3059\u304c\u3001\u8a8d\u8a3c\u3055\u308c\u3066\u3044\u306a\u3044\u30aa\u30ec\u30aa\u30ec\u8a3c\u660e\u66f8\u306a\u306e\u3067<br>CA\u30b5\u30fc\u30d3\u30b9\u304b\u3089\u8a8d\u8a3c\u6e08\u307f\u306e\u8a3c\u660e\u66f8\u3092\u5165\u624b\u3057\u3001\u5dee\u3057\u66ff\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u7121\u6599\u306eCA\u3067\u6709\u540d\u305d\u3046\u306a\uff1fletsencrypt\u3092\u4f7f\u3063\u3066\u307f\u307e\u3059\u3002<br>\u666e\u901a\u306f\u7d50\u69cb\u9ad8\u984d\u306a\u91d1\u984d\u304c\u639b\u304b\u308b\u3089\u3057\u3044\u3067\u3059\u304c\u7121\u6599\u3067\u4f7f\u3048\u308b\u305d\u3046\u3067\u3059\u3002\u52a9\u304b\u308b\u3002<br><a href=\"https:\/\/letsencrypt.jp\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/letsencrypt.jp\/<\/a><\/p>\n<p>\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u306a\u3069\u4e0d\u8981\u3067\u3001Certbot\u3068\u3044\u3046\u30bd\u30d5\u30c8\u3092\u5165\u308c\u308b\u3060\u3051\u3067\u3044\u3051\u307e\u3059\u3002<br>debian\u306ebackports\u30d1\u30c3\u30b1\u30fc\u30b8\u306bcertbot\u304c\u5165\u3063\u3066\u3044\u307e\u3059\u306e\u3067\u3001apt\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br>\u203bbackports\u306f\u6a19\u6e96\u3067\u306fsources.list\u306b\u5165\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u8ffd\u52a0\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# \u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\n$ sudo apt install certbot python-certbot-apache\n# \u8a3c\u660e\u66f8\u306e\u5165\u624b\u3068apache\u3078\u306e\u9069\u5fdc\u3092\u884c\u3044\u307e\u3059\n$ certbot --apache\n<\/pre><\/pre>\n<p>&#8211;apache\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u305f\u3053\u3068\u306b\u3088\u308a\u3001sites-available\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b &#8220;000-default-le-ssl.conf&#8221; \u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30d5\u30a1\u30a4\u30eb\u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u308a\u307e\u3059\u3002<br>\u305d\u3057\u3066\u3001&#8221;000-default-le-ssl.conf&#8221; \u304b\u3089\/etc\/letsencrypt\/live\/helloidea.org\/(\u7565) \u3078\u306e\u8a3c\u660e\u66f8\u306e\u53c2\u7167\u304c\u3042\u308b\u3053\u3068\u3082\u5206\u308a\u307e\u3059\u3002<br>\u307e\u305f\u3001\/etc\/cron.d\/certbot \u306b1\u65e52\u56de\u306e\u8a3c\u660e\u66f8\u66f4\u65b0\u30af\u30ed\u30fc\u30f3\u304c\u7f6e\u304b\u308c\u308b\u305f\u3081\u3001\u8a3c\u660e\u66f8\u306e\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u3082\u4e0d\u8981\u306e\u69d8\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u3001https\u5316\u5b8c\u4e86\u3067\u3059\u3002<br>\u6700\u5f8c\u306b\u65e2\u5b58\u306ehttp\u30ea\u30f3\u30af\u3092https\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u305b\u307e\u3059<br>.htaccess\u306e\u5909\u66f4\u3068\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u5bfe\u5fdc\u3067\u304d\u307e\u3059<\/p>\n<pre><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# http\u304b\u3089https\u3078\u5f37\u5236\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\nRewriteCond %{HTTPS} off\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} &#x5B;R=301,L]\n<\/pre><\/pre>\n<p>\u30d7\u30e9\u30b0\u30a4\u30f3: <a href=\"https:\/\/ja.wordpress.org\/plugins\/really-simple-ssl\/\">Really Simple SSL<\/a><\/p>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7d50\u69cb\u524d\u304b\u3089Google\u304c\u672c\u6c17\u3067https\u5316\u3092\u4fc3\u3057\u3066\u3044\u3066\u3001\u6c17\u306b\u306f\u3057\u3066\u3044\u305f\u3082\u306e\u306e\u7d50\u5c40\u653e\u7f6e\u3057\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u6c17\u304c\u5411\u3044\u305f\u306e\u3067https\u5316\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002 \u25a0\u74b0\u5883Apache2 &#8211; 2.4.25-3+deb9u5 \u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[],"class_list":["post-1780","post","type-post","status-publish","format-standard","hentry","category-memo"],"_links":{"self":[{"href":"https:\/\/helloidea.org\/index.php\/wp-json\/wp\/v2\/posts\/1780","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/helloidea.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/helloidea.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/helloidea.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/helloidea.org\/index.php\/wp-json\/wp\/v2\/comments?post=1780"}],"version-history":[{"count":23,"href":"https:\/\/helloidea.org\/index.php\/wp-json\/wp\/v2\/posts\/1780\/revisions"}],"predecessor-version":[{"id":1998,"href":"https:\/\/helloidea.org\/index.php\/wp-json\/wp\/v2\/posts\/1780\/revisions\/1998"}],"wp:attachment":[{"href":"https:\/\/helloidea.org\/index.php\/wp-json\/wp\/v2\/media?parent=1780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/helloidea.org\/index.php\/wp-json\/wp\/v2\/categories?post=1780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/helloidea.org\/index.php\/wp-json\/wp\/v2\/tags?post=1780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}