{"id":3113,"date":"2019-01-24T17:37:46","date_gmt":"2019-01-24T08:37:46","guid":{"rendered":"https:\/\/taitan916.info\/blog\/?p=3113"},"modified":"2024-02-22T22:34:07","modified_gmt":"2024-02-22T13:34:07","slug":"post-3113","status":"publish","type":"post","link":"https:\/\/taitan916.info\/blog\/archives\/3113","title":{"rendered":"CentOS6.10\u306b\u7121\u6599SSL(Let's Encrypt)\u3092\u5c0e\u5165"},"content":{"rendered":"<p>\u4ee5\u524d\u306b\u3082<a href=\"https:\/\/taitan916.info\/blog\/?p=2691\">VPS\u306bLet's Encrypt\u3092\u5c0e\u5165\u3059\u308b\u3068\u3044\u3046\u8a18\u4e8b<\/a>\u3092\u66f8\u3044\u305f\u304c\u3001\u30c6\u30b9\u30c8\u3060\u3051\u3057\u3066\u672c\u756a\u5c0e\u5165\u306f\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u3002\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u672c\u756a\u5c0e\u5165\u3057\u3088\u3046\u3068\u601d\u3044\u8272\u3005\u8abf\u3079\u308b\u3068\u4ee5\u524d\u3068\u306f\u82e5\u5e72\u65b9\u6cd5\u304c\u5909\u308f\u3063\u3066\u3044\u308b\u3088\u3046\u3060\u3063\u305f\u3002\u307e\u305f\u3001\u4eca\u56de\u306f\u30b5\u30d6\u30c9\u30e1\u30a4\u30f3\u306b\u5bfe\u3057\u3066\u3082SSL\u3092\u5c0e\u5165\u3057\u305f\u3044\u306e\u3067\u3001\u5bfe\u5fdc\u3057\u305f\u5185\u5bb9\u3092\u30e1\u30e2\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>SSL\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4f5c\u696d<\/h2>\n<p>\u30b5\u30fc\u30d0\u306bSSH\u63a5\u7d9a\u3057\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u9032\u3081\u3066\u3044\u304f\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#python\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\r\npython --version\r\nPython 2.6.6\r\n\r\n#python2.7\u3092\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\r\nyum -y install centos-release-scl\r\nyum -y install scl-utils python27 python27-scldevel\r\nscl enable python27 bash\r\n\r\n#\u518d\u5ea6python\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\r\npython --version\r\nPython 2.7.13\r\n\r\n#certbot-auto\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\nyum -y install epel-release\r\ncurl https:\/\/dl.eff.org\/certbot-auto -o \/usr\/bin\/certbot-auto\r\nchmod a+x \/usr\/bin\/certbot-auto\r\ncertbot-auto --os-packages-only --non-interactive\r\n\r\n#\u8a3c\u660e\u66f8\u3092\u4f5c\u6210(hogehoge.com\u3068hogehoge@gmail.com\u306f\u9069\u5b9c\u5909\u66f4\u3059\u308b)\r\ncertbot-auto certonly --non-interactive --agree-tos --webroot -w \/var\/www\/html -d hogehoge.com --email hogehoge@gmail.com\r\n\r\n#\u8a3c\u660e\u66f8\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d(\u4f5c\u6210\u3055\u308c\u3066\u3044\u308c\u3070.pem\u30d5\u30a1\u30a4\u30eb\u304c\u8907\u6570\u8868\u793a\u3055\u308c\u308b)\r\nll \/etc\/letsencrypt\/live\/hogehoge.com\/<\/pre>\n<p>&nbsp;<\/p>\n<h2>Apache\u306e\u8a2d\u5b9a\u4f5c\u696d<\/h2>\n<p>\u30b5\u30fc\u30d0\u306bSSH\u63a5\u7d9a\u3057\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u9032\u3081\u3066\u3044\u304f\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">vi \/etc\/httpd\/conf.d\/ssl.conf\r\n\r\n#\u4ee5\u4e0b\u90e8\u5206\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u8ffd\u8a18\r\n#SSLCertificateFile \/etc\/pki\/tls\/certs\/localhost.crt\r\nSSLCertificateFile \/etc\/letsencrypt\/live\/hogehoge.com\/fullchain.pem\r\n\r\n#\u4ee5\u4e0b\u90e8\u5206\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u8ffd\u8a18\r\n#SSLCertificateKeyFile \/etc\/pki\/tls\/private\/localhost.key\r\nSSLCertificateKeyFile \/etc\/letsencrypt\/live\/hogehoge.com\/privkey.pem\r\n\r\n#Apache\u306e\u518d\u8d77\u52d5\r\nservice httpd restart<\/pre>\n<p>\u3053\u306e\u6642\u70b9\u3067\u30d6\u30e9\u30a6\u30b6\u304b\u3089HTTPS\u63a5\u7d9a\u304c\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30b5\u30d6\u30c9\u30e1\u30a4\u30f3\u3092\u8ffd\u52a0\u3059\u308b\u5834\u5408<\/h2>\n<p>\u30b5\u30fc\u30d0\u306bSSH\u63a5\u7d9a\u3057\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u9032\u3081\u3066\u3044\u304f\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#\u8a3c\u660e\u66f8\u3092\u4f5c\u6210\r\ncertbot-auto certonly --non-interactive --agree-tos --webroot -w \/var\/www\/html\/sub -d sub.hogehoge.com --email hogehoge@gmail.com\r\n\r\n#Apache\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\r\nvi \/etc\/httpd\/conf\/httpd.conf\r\n\r\n#\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3059\u308b\r\n&lt;VirtualHost *:443&gt;\r\n    ServerAdmin sub.hogehoge.com\r\n    DocumentRoot \/var\/www\/html\/sub\r\n    ServerName sub.hogehoge.com\r\n    ErrorLog logs\/error_log\r\n    CustomLog logs\/access_log common\r\n\r\n    SSLEngine on\r\n    SSLCertificateFile \/etc\/letsencrypt\/live\/sub.hogehoge.com\/fullchain.pem\r\n    SSLCertificateKeyFile \/etc\/letsencrypt\/live\/sub.hogehoge.com\/privkey.pem\r\n   NameVirtualhost *:443\r\n&lt;\/VirtualHost&gt;\r\n\r\n#Apache\u306e\u518d\u8d77\u52d5\r\nservice httpd restart<\/pre>\n<p>\u3053\u306e\u6642\u70b9\u3067\u30d6\u30e9\u30a6\u30b6\u304b\u3089HTTPS\u63a5\u7d9a\u304c\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u81ea\u52d5\u66f4\u65b0\u8a2d\u5b9a<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#cron\u8a2d\u5b9a\r\nvi \/etc\/crontab\r\n\r\n#\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3059\u308b\r\n30 2 * * * scl enable python27 \"\/usr\/bin\/certbot-auto renew\" &amp;&amp; sleep 120 &amp;&amp; \/etc\/init.d\/httpd restart<\/pre>\n<p>&nbsp;<\/p>\n<h2>WordPress\u3067SSL\u5316\u3057\u305f\u5834\u5408<\/h2>\n<p>WordPress\u306b\u9650\u3089\u305ahttp\u304b\u3089https\u306b\u79fb\u884c\u3057\u305f\u5834\u5408\u3001\u30bd\u30fc\u30b9\u5185\u306b\u7d76\u5bfe\u30d1\u30b9\u304c\u5165\u3063\u3066\u3044\u308b\u3068\u6df7\u5728\u30a2\u30af\u30c6\u30a3\u30d6\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u3069\u3046\u306e\u3053\u3046\u306e\u3067CSS\u3084JS\u306a\u3069\u306e\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u304c\u8aad\u307f\u8fbc\u3081\u305a\u3001\u8868\u793a\u304c\u5d29\u308c\u308b\u5834\u5408\u304c\u3042\u308b\u3002\u81ea\u8eab\u3067\u4f5c\u6210\u3057\u305f\u30b7\u30b9\u30c6\u30e0\u3067\u3042\u308c\u3070\u4e00\u3064\u305a\u3064\u66f8\u304d\u63db\u3048\u3066\u3044\u304f\u3057\u304b\u306a\u3044\u3068\u601d\u3046\u304c\u3001WordPress\u306e\u5834\u5408\u306f\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u5bfe\u5fdc\u3067\u304d\u308b\u3002<\/p>\n<p>\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u4e0a\u3088\u308a\u300cReally Simple SSL\u300d\u3067\u691c\u7d22\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u304b\u3001\u4ee5\u4e0b\u516c\u5f0f\u30da\u30fc\u30b8\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002\u6709\u52b9\u5316\u3059\u308b\u3060\u3051\u3067\u53cd\u6620\u3055\u308c\u305f\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"PgkUmXAcVo\"><p><a href=\"https:\/\/ja.wordpress.org\/plugins\/really-simple-ssl\/\">Really Simple SSL &#8211; Simple and Lightweight Security<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Really Simple SSL &#8211; Simple and Lightweight Security&#8221; &#8212; Plugin Directory\" src=\"https:\/\/ja.wordpress.org\/plugins\/really-simple-ssl\/embed\/#?secret=i6gBmEvC8p#?secret=PgkUmXAcVo\" data-secret=\"PgkUmXAcVo\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>\u5c1a\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u7cfb\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30af\u30ea\u30a2\u3059\u308b\u3053\u3068\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u53c2\u8003\u30b5\u30a4\u30c8<\/h2>\n<p><a href=\"https:\/\/www.101010.fun\/entry\/lets-encrypt-centos6\">https:\/\/www.101010.fun\/entry\/lets-encrypt-centos6<\/a><br \/>\n<a href=\"https:\/\/developer-collaboration.com\/2018\/09\/04\/lets-encrypt-apache-centos6\/\">https:\/\/developer-collaboration.com\/2018\/09\/04\/lets-encrypt-apache-centos6\/<\/a><br \/>\n<a href=\"https:\/\/zenlogic.jp\/aossl\/operation\/wp-plugin\/\">https:\/\/zenlogic.jp\/aossl\/operation\/wp-plugin\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u524d\u306b\u3082VPS\u306bLet's Encrypt\u3092\u5c0e\u5165\u3059\u308b\u3068\u3044\u3046\u8a18\u4e8b\u3092\u66f8\u3044\u305f\u304c\u3001\u30c6\u30b9\u30c8 ... <\/p>\n","protected":false},"author":1,"featured_media":4013,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7],"tags":[99],"class_list":["post-3113","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-lets-encrypt"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/comments?post=3113"}],"version-history":[{"count":1,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3113\/revisions"}],"predecessor-version":[{"id":4951,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3113\/revisions\/4951"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media\/4013"}],"wp:attachment":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media?parent=3113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/categories?post=3113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/tags?post=3113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}