{"id":2081,"date":"2018-07-28T21:21:37","date_gmt":"2018-07-28T12:21:37","guid":{"rendered":"http:\/\/hobby.mydns.jp\/teruki.wp\/?p=2081"},"modified":"2018-07-29T01:19:08","modified_gmt":"2018-07-28T16:19:08","slug":"post-2081","status":"publish","type":"post","link":"https:\/\/hobby.mydns.jp\/teruki.wp\/2018\/07\/28\/post-2081\/","title":{"rendered":"CentOS7 Let\u2019s Encrypt\u3067SSL(HTTPS)\u5316 \u81ea\u5df1\u8a3c\u660e\u7121\u52b9\u5316"},"content":{"rendered":"<p>CentOS7\u306eWeb\u30b5\u30fc\u30d0\u30fc\u3092SSL\u5bfe\u5fdc\u3055\u305b\u307e\u3057\u305f\u3002<\/p>\n<p>\u3010\u30c8\u30e9\u30d6\u30eb\u3011\u53d6\u5f97\u3057\u305fSSL\u8a3c\u660e\u66f8\u304c\u6709\u52b9\u306b\u306a\u3089\u305ahttps:\/\/\u30a2\u30af\u30bb\u30b9\u3067\u8b66\u544a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u308b\u3002<br \/>\nLet\u2019s Encrypt\u3067\u7121\u6599\u306eSSL\u8a3c\u660e\u66f8\u3092\u53d6\u5f97\u3057\u305f\u306e\u306f\u3044\u3044\u304c\u3001\u3044\u3056\u3001https:\/\/\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u8a3c\u660e\u66f8\u306b\u554f\u984c\u304c\u3042\u308b\u3068\u304b\u3001\u4fdd\u8b77\u3055\u308c\u3066\u3044\u306a\u3044\u3068\u304b\u8b66\u544a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u3066\u3057\u307e\u3046\u3002<br \/>\n\u30fb\u300c\u3053\u306eWeb\u30b5\u30a4\u30c8\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a3c\u660e\u66f8\u306b\u306f\u554f\u984c\u304c\u3042\u308a\u307e\u3059\u300d<br \/>\n\u30fb\u300c\u3053\u306e\u30b5\u30a4\u30c8\u306f\u5b89\u5168\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u300d<br \/>\n\u30fb\u300c\u3053\u306e\u63a5\u7d9a\u3067\u306f\u30d7\u30e9\u30a4\u30d0\u30b7\u30fc\u304c\u4fdd\u8b77\u3055\u308c\u307e\u305b\u3093\u300d<br \/>\n\u30fb\u300c\u5b89\u5168\u306a\u63a5\u7d9a\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u300d<\/p>\n<p>\u3010\u539f\u56e0\u3011ssl.conf\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304b\u308c\u3066\u3044\u308blocalhost\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u305f\u3002<br \/>\n\u30d6\u30e9\u30a6\u30b6\u306e\u8b66\u544a\u306e\u8a73\u7d30\u3092\u898b\u3066\u307f\u308b\u3068\u3001\u671f\u9650\u306e\u5207\u308c\u3066\u3044\u308b\u81ea\u5df1\u8a3c\u660e\u66f8\u304c\u8a8d\u8b58\u3055\u308c\u3066\u3044\u305f\u3002\u539f\u56e0\u306f\u3001mod_ssl\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3068\u304d\u306b\u4f5c\u6210\u3055\u308c\u308b\/etc\/httpd\/conf.d\/ssl.conf\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u8a3c\u660e\u66f8\u306e\u65b9\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u539f\u56e0\u3060\u3063\u305f\u3002<\/p>\n<p># Server Certificate:<br \/>\n# Point SSLCertificateFile at a PEM encoded certificate. If<br \/>\n# the certificate is encrypted, then you will be prompted for a<br \/>\n# pass phrase. Note that a kill -HUP will prompt again. A new<br \/>\n# certificate can be generated using the genkey(1) command.<br \/>\nSSLCertificateFile \/etc\/pki\/tls\/certs\/localhost.crt\u3000\u2190\u2605<\/p>\n<p># Server Private Key:<br \/>\n# If the key is not combined with the certificate, use this<br \/>\n# directive to point at the key file. Keep in mind that if<br \/>\n# you&#8217;ve both a RSA and a DSA private key you can configure<br \/>\n# both in parallel (to also allow the use of DSA ciphers, etc.)<br \/>\nSSLCertificateKeyFile \/etc\/pki\/tls\/private\/localhost.key\u3000\u2190\u2605<\/p>\n<p># Server Certificate Chain:<br \/>\n# Point SSLCertificateChainFile at a file containing the<br \/>\n# concatenation of PEM encoded CA certificates which form the<br \/>\n# certificate chain for the server certificate. Alternatively<br \/>\n# the referenced file can be the same as SSLCertificateFile<br \/>\n# when the CA certificates are directly appended to the server<br \/>\n# certificate for convinience.<br \/>\nSSLCertificateChainFile \/etc\/pki\/tls\/certs\/server-chain.crt\u3000\u2190\u2605<\/p>\n<p>\u3010\u5bfe\u7b56\u3011\/etc\/httpd\/conf.d\/ssl.conf\u3092\u4fee\u6b63\u3057\u3066\u53d6\u5f97\u3057\u305f\u8a3c\u660e\u66f8\u306b\u5dee\u3057\u66ff\u3048\u308b\u3002<br \/>\nLet\u2019s Encrypt\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u751f\u6210\u3055\u308c\u308b\/etc\/httpd\/conf\/httpd-le-ssl.conf\u3060\u3051\u3067\u306f\u3053\u306e\u4e2d\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u8a3c\u660e\u66f8\u304c\u6709\u52b9\u306b\u306a\u3089\u306a\u304b\u3063\u305f\u3002\/etc\/httpd\/conf.d\/ssl.conf\u306e\u4e0a\u306e\u2605\u5370\u90e8\u5206\u3092httpd-le-ssl.conf\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u306b\u7f6e\u304d\u63db\u3048\u308b\u3053\u3068\u3067\u6709\u52b9\u306b\u306a\u3063\u305f\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2090\" src=\"https:\/\/hobby.mydns.jp\/teruki.wp\/wp-content\/uploads\/2018\/07\/ssl.png\" alt=\"\" width=\"1179\" height=\"575\" \/><\/p>\n<p>****************************************************************<br \/>\nSSL\u5316\u624b\u9806<br \/>\n****************************************************************<br \/>\n\u25a0Certbot \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u524d\u306e\u6e96\u5099<br \/>\n\u25c7\u4eee\u60f3\u30db\u30b9\u30c8 \u30dd\u30fc\u30c880\u3092\u8ffd\u52a0\u3057\u3066\u304a\u304f<br \/>\n\u3010\u30c8\u30e9\u30d6\u30eb\u3011\u6700\u521d\u306e\u7acb\u3061\u4e0a\u3052\u3067%&gt;sudo certbot \u3060\u3051\u3067\u5b9f\u884c\u3057\u305f\u3068\u304d\u306b\u51fa\u307e\u3057\u305f\u3002<br \/>\n\u203b\u307e\u305f\u3001\u30dd\u30fc\u30c880\u3067\u4eee\u60f3\u30db\u30b9\u30c8\u3092\u898b\u3064\u3051\u3089\u308c\u306a\u304b\u3063\u305f\u306e\u3067\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>No names were found in your configuration files. Please enter in your domain<br \/>\nname(s) (comma and\/or space separated) (Enter &#8216;c&#8217; to cancel):\u3000\u30db\u30b9\u30c8\u540d\u3092\u5165\u529b\u3057\u3066Enter<\/p>\n<p>\u4f8b\uff09name(s) (comma and\/or space separated) (Enter &#8216;c&#8217; to cancel): hobby.mydns.jp<br \/>\nObtaining a new certificate<br \/>\nResetting dropped connection: acme-v01.api.letsencrypt.org<br \/>\nPerforming the following challenges:<br \/>\nhttp-01 challenge for hobby.mydns.jp<br \/>\nCleaning up challenges<br \/>\nUnable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.\u3000\u2190\u2605<\/p>\n<p>IMPORTANT NOTES:<br \/>\n&#8211; Your account credentials have been saved in your Certbot<br \/>\nconfiguration directory at \/etc\/letsencrypt. You should make a<br \/>\nsecure backup of this folder now. This configuration directory will<br \/>\nalso contain certificates and private keys obtained by Certbot so<br \/>\nmaking regular backups of this folder is ideal.<\/p>\n<p>\u3010\u5bfe\u7b56\u3011\/etc\/httpd\/conf\/httpd.conf\u306e\u6587\u672b\u306b\u4e0b\u8a18\u3092\u633f\u5165<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n<del>NameVirtualHost *:80<\/del>\u3000\u2190\u3000\/var\/log\/messages\u3067\u610f\u5473\u306a\u3057\u3068\u3044\u3046\u300cAH00548:\u300d\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u308b\u306e\u3067<a href=\"http:\/\/thinkami.hatenablog.com\/entry\/2016\/05\/29\/060000\">\u524a\u9664<\/a>\u3057\u307e\u3057\u305f<br \/>\n&lt;VirtualHost *:80&gt;<br \/>\nServerAdmin root@hobby.mydns.jp<br \/>\nDocumentRoot \/var\/www\/html<br \/>\nServerName hobby.mydns.jp<br \/>\n&lt;\/VirtualHost&gt;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>\u25a0<a href=\"https:\/\/letsencrypt.jp\/usage\/install-certbot.html#CentOS7\">Certbot \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><br \/>\n%&gt;sudo yum install epel-release<br \/>\n%&gt;sudo yum install certbot python-certbot-apache<\/p>\n<p>\u25a0ssl\u8a3c\u660e\u66f8\u306e\u53d6\u5f97<br \/>\n%&gt;sudo certbot run -d \u30c9\u30e1\u30a4\u30f3\u540d<br \/>\n\u4f8b\uff09%&gt;sudo certbot run -d hobby.mydns.jp<\/p>\n<p>\u25c7\u521d\u56de\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u554f\u3044\u5408\u308f\u305b\u304c\u51fa\u307e\u3059\u3002<br \/>\nSaving debug log to \/var\/log\/letsencrypt\/letsencrypt.log<br \/>\nPlugins selected: Authenticator apache, Installer apache<br \/>\nEnter email address (used for urgent renewal and security notices) (Enter &#8216;c&#8217; tocancel):\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u3066Enter<\/p>\n<p>\u25c7\u898f\u7d04\u306b\u540c\u610f\u3059\u308b<br \/>\nStarting new HTTPS connection (1): acme-v01.api.letsencrypt.org<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nPlease read the Terms of Service at<br \/>\nhttps:\/\/letsencrypt.org\/documents\/LE-SA-v1.2-November-15-2017.pdf. You must<br \/>\nagree in order to register with the ACME server at<br \/>\nhttps:\/\/acme-v01.api.letsencrypt.org\/directory<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n(A)gree\/(C)ancel: a\u3092\u5165\u529b\u3057\u3066Enter<\/p>\n<p>\u25c7SSL\u8a3c\u660e\u66f8\u3092\u5229\u7528\u3059\u308b\u3060\u3051\u306a\u3089n\u3092\u9078\u629e<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nWould you be willing to share your email address with the Electronic Frontier<br \/>\nFoundation, a founding partner of the Let&#8217;s Encrypt project and the non-profit<br \/>\norganization that develops Certbot? We&#8217;d like to send you email about our work<br \/>\nencrypting the web, EFF news, campaigns, and ways to support digital freedom.<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n(Y)es\/(N)o: n\u3092\u5165\u529b\u3057\u3066Enter<\/p>\n<p>\u25c7HTTPS\u5316\u3057\u305f\u3044\u30b5\u30a4\u30c8\u306e\u30db\u30b9\u30c8\u540d\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u8a72\u5f53\u3059\u308b\u756a\u53f7\u3092\u9078\u629e<br \/>\nWhich names would you like to activate HTTPS for?<br \/>\n&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<br \/>\n1: hobby.mydns.jp<br \/>\n&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<br \/>\nSelect the appropriate numbers separated by commas and\/or spaces, or leave input<br \/>\nblank to select all options shown (Enter &#8216;c&#8217; to cancel): 1<\/p>\n<p>\u25c7\u8a3c\u660e\u66f8\u306e\u767a\u884c\u624b\u7d9a\u304d\u304c\u3055\u308c\u3001\/etc\/httpd\/conf.d\/httpd-le-ssl.conf\u304c\u81ea\u52d5\u7684\u306b\u4f5c\u6210\u3055\u308c\u308b\u3002<br \/>\nObtaining a new certificate<br \/>\nPerforming the following challenges:<br \/>\nhttp-01 challenge for hobby.mydns.jp<br \/>\nWaiting for verification&#8230;<br \/>\nCleaning up challenges<br \/>\nCreated an SSL vhost at \/etc\/httpd\/conf\/httpd-le-ssl.conf<br \/>\nDeploying Certificate to VirtualHost \/etc\/httpd\/conf\/httpd-le-ssl.conf<br \/>\nEnabling site \/etc\/httpd\/conf\/httpd-le-ssl.conf by adding Include to root configuration<\/p>\n<p>\u25c7HTTP\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092HTTPS\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u304b\u5c0b\u306d\u3089\u308c\u308b<br \/>\nPlease choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.<br \/>\n&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<br \/>\n1: No redirect &#8211; Make no further changes to the webserver configuration.<br \/>\n2: Redirect &#8211; Make all requests redirect to secure HTTPS access. Choose this for<br \/>\nnew sites, or if you&#8217;re confident your site works on HTTPS. You can undo this<br \/>\nchange by editing your web server&#8217;s configuration.<br \/>\n&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<br \/>\nSelect the appropriate number [1-2] then [enter] (press &#8216;c&#8217; to cancel): 1\u3092\u9078\u629e\u3057\u3066\u624b\u52d5\u3067\u8a2d\u5b9a\u3057\u3066\u307f\u308b\u3002<\/p>\n<p>\u25c7\u8a3c\u660e\u66f8\u767a\u884c\u5b8c\u4e86<br \/>\n&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<br \/>\nCongratulations! You have successfully enabled https:\/\/hobby.mydns.jp<\/p>\n<p>You should test your configuration at:<br \/>\nhttps:\/\/www.ssllabs.com\/ssltest\/analyze.html?d=hobby.mydns.jp<br \/>\n&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<br \/>\n\u2191\u3053\u3053\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u308b\u3068\u3001https\u30a2\u30af\u30bb\u30b9\u3067\u304d\u3066\u3044\u308c\u3070Grade\u6b04\u306b\u300cB\u300d\u3068\u304b\u8a18\u53f7\u304c\u51fa\u3066\u304d\u3066\u8a73\u7d30\u304c\u898b\u3089\u308c\u308b\u3002<br \/>\nIMPORTANT NOTES:<br \/>\n&#8211; Congratulations! Your certificate and chain have been saved at:<br \/>\n\/etc\/letsencrypt\/live\/hobby.mydns.jp\/fullchain.pem<br \/>\nYour key file has been saved at:<br \/>\n\/etc\/letsencrypt\/live\/hobby.mydns.jp\/privkey.pem<br \/>\nYour cert will expire on 2018-10-24. To obtain a new or tweaked<br \/>\nversion of this certificate in the future, simply run certbot-auto<br \/>\nagain with the &#8220;certonly&#8221; option. To non-interactively renew *all*<br \/>\nof your certificates, run &#8220;certbot-auto renew&#8221;<br \/>\n&#8211; If you like Certbot, please consider supporting our work by:<\/p>\n<p>Donating to ISRG \/ Let&#8217;s Encrypt: https:\/\/letsencrypt.org\/donate<br \/>\nDonating to EFF: https:\/\/eff.org\/donate-le<\/p>\n<p>\u2191\u8a3c\u660e\u66f8\u306e\u4fdd\u5b58\u5834\u6240\u306f\/etc\/letsencrypt\/live\/[\u30db\u30b9\u30c8\u540d]\/\u306b\u3042\u308b\u3053\u3068\u3068\u3001\u6709\u52b9\u671f\u9650\u304c2018-10-24\u3067\u3042\u308b\u3053\u3068\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u25c7\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u78ba\u8a8d<br \/>\n\u30fb\/etc\/httpd\/conf\/httpd-le-ssl.conf\u3000\u304c\u4f5c\u6210\u3055\u308c\u3001\u4e2d\u306b\u8a3c\u660e\u66f8\u306e\u30d1\u30b9\u304c\u5207\u3089\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n&lt;IfModule mod_ssl.c&gt;<br \/>\n&lt;VirtualHost *:443&gt;<br \/>\nServerAdmin root@hobby.mydns.jp<br \/>\nDocumentRoot \/var\/www\/html<br \/>\nServerName hobby.mydns.jp<br \/>\nSSLCertificateFile \/etc\/letsencrypt\/live\/hobby.mydns.jp\/cert.pem<br \/>\nSSLCertificateKeyFile \/etc\/letsencrypt\/live\/hobby.mydns.jp\/privkey.pem<br \/>\nInclude \/etc\/letsencrypt\/options-ssl-apache.conf<br \/>\nSSLCertificateChainFile \/etc\/letsencrypt\/live\/hobby.mydns.jp\/chain.pem<br \/>\n&lt;\/VirtualHost&gt;<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p>\u30fb\/etc\/httpd\/conf\/httpd.conf\u3000\u304c\u66f4\u65b0\u3055\u308c\u3001\u6587\u672b\u306b\u4e0b\u8a18\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u3002<br \/>\nInclude \/etc\/httpd\/conf\/httpd-le-ssl.conf<\/p>\n<p>\u25c7\/etc\/httpd\/conf.d\/ssl.conf\u3000\u306e\u4fee\u6b63<br \/>\n\u30da\u30fc\u30b8\u306e\u5148\u982d\u306b\u8a18\u8ff0\u3057\u305f\u30c8\u30e9\u30d6\u30eb\u5bfe\u7b56\u3068\u3057\u3066\u3001\u2605\u5370\u3092\u7121\u52b9\u5316\u3057\u3066\u3001\u2606\u5370\u3092\u8a2d\u5b9a\u3059\u308b\u3002<br \/>\n# Server Certificate:<br \/>\n# Point SSLCertificateFile at a PEM encoded certificate. If<br \/>\n# the certificate is encrypted, then you will be prompted for a<br \/>\n# pass phrase. Note that a kill -HUP will prompt again. A new<br \/>\n# certificate can be generated using the genkey(1) command.<br \/>\n#SSLCertificateFile \/etc\/pki\/tls\/certs\/localhost.crt\u3000\u2190\u2605<br \/>\nSSLCertificateFile \/etc\/letsencrypt\/live\/hobby.mydns.jp\/cert.pem\u3000\u2190\u2606<\/p>\n<p># Server Private Key:<br \/>\n# If the key is not combined with the certificate, use this<br \/>\n# directive to point at the key file. Keep in mind that if<br \/>\n# you&#8217;ve both a RSA and a DSA private key you can configure<br \/>\n# both in parallel (to also allow the use of DSA ciphers, etc.)<br \/>\n#SSLCertificateKeyFile \/etc\/pki\/tls\/private\/localhost.key\u3000\u2190\u2605<br \/>\nSSLCertificateKeyFile \/etc\/letsencrypt\/live\/hobby.mydns.jp\/privkey.pem\u3000\u2190\u2606<\/p>\n<p># Server Certificate Chain:<br \/>\n# Point SSLCertificateChainFile at a file containing the<br \/>\n# concatenation of PEM encoded CA certificates which form the<br \/>\n# certificate chain for the server certificate. Alternatively<br \/>\n# the referenced file can be the same as SSLCertificateFile<br \/>\n# when the CA certificates are directly appended to the server<br \/>\n# certificate for convinience.<br \/>\n#SSLCertificateChainFile \/etc\/pki\/tls\/certs\/server-chain.crt\u3000\u2190\u2605<br \/>\nSSLCertificateChainFile \/etc\/letsencrypt\/live\/hobby.mydns.jp\/chain.pem\u3000\u2190\u2606<\/p>\n<p>\u25c7httpd\u518d\u8d77\u52d5<br \/>\n%&gt;systemctl restart httpd.service<\/p>\n<p>\u25a0http\u304b\u3089https\u3078\u306e301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<br \/>\n\u300chttp:\/\/\uff5e\u300d\u3068\u300chttps:\/\/\uff5e\u300d\u304c\u540c\u3058\u30b3\u30f3\u30c6\u30f3\u30c4\u3067\u3082Google\u306f\u5225\u306e\u30da\u30fc\u30b8\u3068\u8a8d\u8b58\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305d\u3046\u3067\u8a55\u4fa1\u3092\u5f15\u304d\u7d99\u3050\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u304c\u5fc5\u8981\u3002<br \/>\n\u3010\u5bfe\u7b56\u3011\/etc\/httpd\/conf\/httpd.conf\u306e\u6587\u672b\u306b\u4e0b\u8a18\u306e\u592a\u6587\u5b57\u3092\u633f\u5165<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n<del>NameVirtualHost *:80<\/del>\u3000\u2190\u3000\/var\/log\/messages\u3067\u610f\u5473\u306a\u3057\u3068\u3044\u3046\u300cAH00548:\u300d\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u308b\u306e\u3067<a href=\"http:\/\/thinkami.hatenablog.com\/entry\/2016\/05\/29\/060000\">\u524a\u9664<\/a>\u3057\u307e\u3057\u305f<br \/>\n&lt;VirtualHost *:80&gt;<br \/>\nServerAdmin root@hobby.mydns.jp<br \/>\nDocumentRoot \/var\/www\/html<br \/>\nServerName hobby.mydns.jp<br \/>\n<strong> RewriteEngine on<\/strong><br \/>\n<strong>RewriteCond %{HTTPS} off<\/strong><br \/>\n<strong>RewriteRule ^(.*)$ https:\/\/hobby.mydns.jp\/$1 [R=301,L]<\/strong><br \/>\n&lt;\/VirtualHost&gt;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n\u25c7httpd\u518d\u8d77\u52d5<br \/>\n%&gt;systemctl restart httpd.service<\/p>\n<p>\u25c7<a href=\"https:\/\/centosinstall.com\/centos\/centos7\/letsencrypt\">Let&#8217;s Encrypt\uff08HTTPS\uff09\u304c90\u65e5\u3067\u671f\u9650\u5207\u308c\u306b\u306a\u308b\u5bfe\u7b56\uff01<\/a>\u6bce\u67081\u65e5\u3001\u5348\u524d5\u6642\u306b\u66f4\u65b0\u78ba\u8a8d<br \/>\n\/etc\/crontab\u306b\u4e0b\u8a18\u3092\u8ffd\u52a0\u3002\u203bcrontab -e\u3067\u306e\u8a2d\u5b9a\u306f\u3057\u306a\u3044\u3067\u76f4\u63a5\u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u8f09\u3002<br \/>\n<del>0 5 1 * * root certbot renew &#8211;quiet<\/del><br \/>\n\u2193\u3000<span style=\"color: #339966;\">httpd\u306e\u518d\u8d77\u52d5\u3082\u5fc5\u8981<\/span>\u3089\u3057\u3044\u306e\u3067\u8a2d\u5b9a\u5909\u66f4<br \/>\n\u203b\u66f4\u306b<a href=\"https:\/\/weblabo.oscasierra.net\/letsencrypt-renew-cron\/\">\u8a3c\u660e\u66f8\u306e\u66f4\u65b0\u7d50\u679c\u3092\u30e1\u30fc\u30eb\u3067\u53d7\u3051\u53d6\u308b<\/a>\u65b9\u6cd5\u306b\u5909\u66f4<br \/>\n00 05 01 * * certbot renew <span style=\"color: #ff6600;\">&#8211;dry-run<\/span> 2&gt;&amp;1 | mail -s &#8220;Let&#8217;s Encrypt update information&#8221; myname@mydomain.com <span style=\"color: #339966;\">&amp;&amp; systemctl restart httpd<\/span><\/p>\n<p><span style=\"color: #ff6600;\">&#8211;dry-run<\/span>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u3066\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u30e2\u30fc\u30c9\u3067\u306e\u66f4\u65b0\u30c6\u30b9\u30c8\u5b9f\u884c\u3057\u305f\u53d7\u4fe1\u30e1\u30fc\u30eb\u306e\u7d50\u679c<br \/>\n\u203b\u66f4\u65b0\u306b\u6210\u529f\u3057\u305f\u65e8\u304c\u8a18\u8ff0\u3055\u308c\u3066\u3044\u308b\u3002<br \/>\n<span style=\"font-size: 8pt;\">&#8212;&#8212;&#8212;- Forwarded message &#8212;&#8212;&#8212;<\/span><br \/>\n<span style=\"font-size: 8pt;\">From: root &lt;root@mydomain.com&gt;<\/span><br \/>\n<span style=\"font-size: 8pt;\">Date: 2018\u5e749\u67081\u65e5(\u571f) 8:30<\/span><br \/>\n<span style=\"font-size: 8pt;\">Subject: Let&#8217;s Encrypt update information<\/span><br \/>\n<span style=\"font-size: 8pt;\">To: &lt;myname@mydomain.com&gt;<\/span><br \/>\n<span style=\"font-size: 8pt;\">Saving debug log to \/var\/log\/letsencrypt\/letsencrypt.log<\/span><br \/>\n<span style=\"font-size: 8pt;\">&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/span><br \/>\n<span style=\"font-size: 8pt;\">Processing \/etc\/letsencrypt\/renewal\/hobby.mydns.jp.conf<\/span><br \/>\n<span style=\"font-size: 8pt;\">&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/span><br \/>\n<span style=\"font-size: 8pt;\">Cert not due for renewal, but simulating renewal for dry run<\/span><br \/>\n<span style=\"font-size: 8pt;\">Plugins selected: Authenticator apache, Installer apache<\/span><br \/>\n<span style=\"font-size: 8pt;\">Starting new HTTPS connection (1): acme-staging-v02.api.letsencrypt.org<\/span><br \/>\n<span style=\"font-size: 8pt;\">Renewing an existing certificate<\/span><br \/>\n<span style=\"font-size: 8pt;\">Performing the following challenges:<\/span><br \/>\n<span style=\"font-size: 8pt;\">http-01 challenge for hobby.mydns.jp<\/span><br \/>\n<span style=\"font-size: 8pt;\">Waiting for verification&#8230;<\/span><br \/>\n<span style=\"font-size: 8pt;\">Cleaning up challenges<\/span><br \/>\n<span style=\"font-size: 8pt;\">&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/span><br \/>\n<span style=\"font-size: 8pt;\">new certificate deployed with reload of apache server; fullchain is<\/span><br \/>\n<span style=\"font-size: 8pt;\">\/etc\/letsencrypt\/live\/hobby.mydns.jp\/fullchain.pem<\/span><br \/>\n<span style=\"font-size: 8pt;\">&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/span><br \/>\n<span style=\"font-size: 8pt;\">&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/span><br \/>\n<span style=\"font-size: 8pt;\">** DRY RUN: simulating &#8216;certbot renew&#8217; close to cert expiry<\/span><br \/>\n<span style=\"font-size: 8pt;\">** (The test certificates below have not been saved.)<\/span><br \/>\n<span style=\"font-size: 8pt; color: #0000ff;\">Congratulations, all renewals succeeded. The following certs have been renewed:<\/span><br \/>\n<span style=\"font-size: 8pt;\">\/etc\/letsencrypt\/live\/hobby.mydns.jp\/fullchain.pem (success)<\/span><br \/>\n<span style=\"font-size: 8pt;\">** DRY RUN: simulating &#8216;certbot renew&#8217; close to cert expiry<\/span><br \/>\n<span style=\"font-size: 8pt;\">** (The test certificates above have not been saved.)<\/span><br \/>\n<span style=\"font-size: 8pt;\">&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/span><\/p>\n<p>vi \/var\/log\/messages\u3067httpd\u306e\u518d\u8d77\u52d5\u304c\u3067\u304d\u3066\u3044\u308b\u3053\u3068\u3082\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\nStarting The Apache HTTP Server&#8230;<\/p>\n<p><span style=\"color: #ff6600;\">&#8211;dry-run<\/span>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5916\u3057\u3066\u672c\u756a\u306e\u5b9f\u884c\u3057\u305f\u53d7\u4fe1\u30e1\u30fc\u30eb\u306e\u7d50\u679c<br \/>\n\u203b\u8a3c\u660e\u66f8\u306e\u671f\u9650\u5207\u308c\u306b\u307e\u3060\u4f59\u88d5\u304c\u3042\u308b\u306e\u3067\u4e0b\u8a18\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u305f<br \/>\n<span style=\"font-size: 8pt;\">&#8212;&#8212;&#8212;- Forwarded message &#8212;&#8212;&#8212;<\/span><br \/>\n<span style=\"font-size: 8pt;\">From: root &lt;root@mydomain.com&gt;<\/span><br \/>\n<span style=\"font-size: 8pt;\">Date: 2018\u5e749\u67081\u65e5(\u571f) 8:43<\/span><br \/>\n<span style=\"font-size: 8pt;\">Subject: Let&#8217;s Encrypt update information<\/span><br \/>\n<span style=\"font-size: 8pt;\">To: &lt;myname@mydomain.com&gt;<\/span><br \/>\n<span style=\"font-size: 8pt;\">Saving debug log to \/var\/log\/letsencrypt\/letsencrypt.log<\/span><br \/>\n<span style=\"font-size: 8pt;\">&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/span><br \/>\n<span style=\"font-size: 8pt;\">Processing \/etc\/letsencrypt\/renewal\/hobby.mydns.jp.conf<\/span><br \/>\n<span style=\"font-size: 8pt;\">&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/span><br \/>\n<span style=\"font-size: 8pt;\">Cert not yet due for renewal<\/span><br \/>\n<span style=\"font-size: 8pt;\">&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/span><br \/>\n<span style=\"font-size: 8pt; color: #0000ff;\">The following certs are not due for renewal yet:<\/span><br \/>\n<span style=\"font-size: 8pt;\">\/etc\/letsencrypt\/live\/hobby.mydns.jp\/fullchain.pem expires on 2018-11-23 (skipped)<\/span><br \/>\n<span style=\"font-size: 8pt;\">No renewals were attempted.<\/span><br \/>\n<span style=\"font-size: 8pt;\">&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/span><\/p>\n<p>****************************************************************<br \/>\n\u5099\u8003<br \/>\n****************************************************************<br \/>\n\u25a0Let\u2019s Encrypt\u3067\u8a3c\u660e\u66f8\u306e\u524a\u9664<br \/>\n\/etc\/letsencrypt\/live\/\u306e[\u30c9\u30e1\u30a4\u30f3\u540d]\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u4e38\u3054\u3068\u524a\u9664\u3055\u308c\u308b\u3002<br \/>\n%&gt;certbot revoke &#8211;cert-path \/etc\/letsencrypt\/live\/[\u30c9\u30e1\u30a4\u30f3\u540d]\/cert.pem<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nWould you like to delete the cert(s) you just revoked?<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n(Y)es (recommended)\/(N)o: y\u3092\u9078\u629e\u3057\u3066Enter<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS7\u306eWeb\u30b5\u30fc\u30d0\u30fc\u3092SSL\u5bfe\u5fdc\u3055\u305b\u307e\u3057\u305f\u3002 \u3010\u30c8\u30e9\u30d6\u30eb\u3011\u53d6\u5f97\u3057\u305fSSL\u8a3c\u660e\u66f8\u304c\u6709\u52b9\u306b\u306a\u3089\u305ahttps:\/\/\u30a2\u30af\u30bb\u30b9\u3067\u8b66\u544a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u308b\u3002 Let\u2019s Encrypt\u3067\u7121\u6599\u306eSSL\u8a3c\u660e\u66f8\u3092\u53d6\u5f97\u3057\u305f\u306e\u306f\u3044\u3044\u304c\u3001 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2090,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-2081","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-unix"],"_links":{"self":[{"href":"https:\/\/hobby.mydns.jp\/teruki.wp\/wp-json\/wp\/v2\/posts\/2081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hobby.mydns.jp\/teruki.wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hobby.mydns.jp\/teruki.wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hobby.mydns.jp\/teruki.wp\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hobby.mydns.jp\/teruki.wp\/wp-json\/wp\/v2\/comments?post=2081"}],"version-history":[{"count":16,"href":"https:\/\/hobby.mydns.jp\/teruki.wp\/wp-json\/wp\/v2\/posts\/2081\/revisions"}],"predecessor-version":[{"id":5438,"href":"https:\/\/hobby.mydns.jp\/teruki.wp\/wp-json\/wp\/v2\/posts\/2081\/revisions\/5438"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hobby.mydns.jp\/teruki.wp\/wp-json\/wp\/v2\/media\/2090"}],"wp:attachment":[{"href":"https:\/\/hobby.mydns.jp\/teruki.wp\/wp-json\/wp\/v2\/media?parent=2081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hobby.mydns.jp\/teruki.wp\/wp-json\/wp\/v2\/categories?post=2081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hobby.mydns.jp\/teruki.wp\/wp-json\/wp\/v2\/tags?post=2081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}