{"id":143,"date":"2021-05-06T04:06:51","date_gmt":"2021-05-05T19:06:51","guid":{"rendered":"https:\/\/auto.meto4d.pgw.jp\/blog\/?p=143"},"modified":"2021-12-21T21:03:48","modified_gmt":"2021-12-21T12:03:48","slug":"mydns%e3%81%aelets-encrypt%e3%81%ae%e3%83%af%e3%82%a4%e3%83%ab%e3%83%89%e3%82%ab%e3%83%bc%e3%83%89%e8%87%aa%e5%8b%95%e6%9b%b4%e6%96%b0%e3%82%92%e5%b0%8e%e5%85%a5%e3%81%97%e3%81%9f","status":"publish","type":"post","link":"https:\/\/auto.meto4d.pgw.jp\/blog\/?p=143","title":{"rendered":"MyDNS\u306eLet&#8217;s Encrypt\u306e\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u81ea\u52d5\u66f4\u65b0\u3092\u5c0e\u5165\u3057\u305f"},"content":{"rendered":"\n<p><a href=\"https:\/\/auto.meto4d.pgw.jp\/blog\/?p=52\">\u524d\u56de(Let\u2019s Encrypt \u3067SSL\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u8a3c\u660e\u66f8\u3092\u5c0e\u5165\u3059\u308b)<\/a>\u306e\u7d9a\u304d\uff1f<br>MyDNS\u304c\u516c\u958b\u3057\u3066\u3044\u308bPHP\u306escript\u3092\u5c0e\u5165\u3057\u3066\u3001renew\u304c\u884c\u3048\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2>\u80cc\u666f<\/h2>\n\n\n\n<p>\u3082\u3068\u3082\u3068Let&#8217;s Encrypt\u3067\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u8a3c\u660e\u66f8\u3092\u5c0e\u5165\u3059\u308b\u524d\u306f<code>certbot renew<\/code>\u3092cron\u306b\u767b\u9332\u3057\u3066\u3044\u3066\u653e\u7f6e\u3057\u3066\u3044\u305f\u3002<br>\u305d\u3057\u3066DNS\u306e\u3068\u304d\u306e\u3068\u540c\u3058\u304f\u3053\u3061\u3089\u3082\u7121\u6599\u3067\u30a2\u30e9\u30fc\u30c8\u30e1\u30fc\u30eb\u3092\u3082\u3089\u3063\u3066\u6c17\u3065\u3044\u305f<br><a href=\"https:\/\/auto.meto4d.pgw.jp\/blog\/?p=52\">\u524d\u56de(Let\u2019s Encrypt \u3067SSL\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u8a3c\u660e\u66f8\u3092\u5c0e\u5165\u3059\u308b)<\/a>\u91cd\u3044\u8170\u3092\u4e0a\u3052\u3066\u5c0e\u5165\u3057\u305f\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u8a3c\u660e\u66f8\u95a2\u4fc2\u304c\u66f4\u65b0\u3067\u304d\u3066\u3044\u306a\u3044\u3088\u3046\u3060<br>\u305d\u306e\u3042\u305f\u308a\u3092\u8abf\u67fb\u3057\u3066\u3001MyDNS\u306e\u81ea\u52d5\u66f4\u65b0\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5c0e\u5165\u3057\u305f\u3002\u3068\u3044\u3046\u304a\u8a71<br>\u3061\u306a\u307f\u306b\u30a2\u30e9\u30fc\u30c8\u30e1\u30fc\u30eb\u306f\u3053\u3093\u306a\u611f\u3058<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"720\" height=\"423\" src=\"https:\/\/auto.meto4d.pgw.jp\/blog\/wp-content\/uploads\/2021\/05\/2021-05-05_0907.jpg\" alt=\"\" class=\"wp-image-146\" srcset=\"https:\/\/auto.meto4d.pgw.jp\/blog\/wp-content\/uploads\/2021\/05\/2021-05-05_0907.jpg 720w, https:\/\/auto.meto4d.pgw.jp\/blog\/wp-content\/uploads\/2021\/05\/2021-05-05_0907-300x176.jpg 300w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><figcaption>Let&#8217;s Encrypt\u304b\u3089\u306e\u30a2\u30e9\u30fc\u30c8\u30e1\u30fc\u30eb\u306f\u3053\u3093\u306a\u611f\u3058<\/figcaption><\/figure>\n\n\n\n<p>JTrim\u3067\u30b3\u30d4\u30da\u3057\u305f\u3093\u3060\u3051\u3069\u3001jpg\u5727\u7e2e\u306e\u54c1\u8cea\u60aa\u3044\u3063\u3059\u306d<br>Affinity\u3082\u3063\u3066\u308b\u3093\u3060\u304b\u3089\u3001\u9762\u5012\u81ed\u304c\u3089\u306a\u3044\u3067\u3001\u305d\u3063\u3061\u3067\u3059\u308b\u3079\u304d\u3060\u3063\u305f\u304b<\/p>\n\n\n\n<h2>\u73fe\u72b6<\/h2>\n\n\n\n<p>\u30a2\u30e9\u30fc\u30c8\u30e1\u30fc\u30eb\u3092\u53d7\u3051\u3066\u3001\u307e\u305a\u306fcron\u306b\u767b\u9332\u3057\u3066\u3044\u308b\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u65bd\u78ba\u8a8d<br>\uff08\u3068\u3001\u305d\u306e\u524d\u306b\u307e\u305a\u306fcron\u78ba\u8a8d\uff09<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:false,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\"># crontab -l\n* * * * * \/bin\/certbot renew &amp;&amp; \/bin\/systemctl reload nginx\n\u2192certbot\u306froot\u3067\u52d5\u304b\u3057\u3066\u3044\u308b\u304c\u3001\u4ed6\u306e\u30e6\u30fc\u30b6\u7ba1\u7406\u306b\u3057\u305f\u3044\u306d\n\u2192cron\u306e\u6642\u9593\u306f\u5ff5\u306e\u70ba\u30de\u30b9\u30af\n\n# type certbot\ncertbot is hashed (\/usr\/bin\/certbot)\n# which certbot\n\/usr\/bin\/certbot\n# ls \/bin\/certbot -l\n-rwxr-xr-x 1 root root 960 Apr  7 10:01 \/bin\/certbot\n# ls \/usr\/bin\/certbot -l\n-rwxr-xr-x 1 root root 960 Apr  7 10:01 \/usr\/bin\/certbot\n\u2192 cron\u306b\u767b\u9332\u3057\u3066\u3044\u308bcertbot\u304c\/bin\u306b\u305f\u3044\u3057\u3066\u3001certbot\u306f\/usr\/bin\u306b\u3042\u3063\u305f\n\u2192 \u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3067\u3082\u30cf\u30fc\u30c9\u30ea\u30f3\u30af\u3067\u3082\u306a\u3044\n# sha256sum \/bin\/certbot\n2e92fb3a6ca39f7de974ca3e4161197cc347139da68484398e575ec817600587  \/bin\/certbot\n# sha256sum \/usr\/bin\/certbot\n2e92fb3a6ca39f7de974ca3e4161197cc347139da68484398e575ec817600587  \/usr\/bin\/certbot\n\u2192\u3069\u3063\u3061\u3068\u3082\u540c\u3058\u30cf\u30c3\u30b7\u30e5\u3067\u554f\u984c\u3082\u306a\u304f\u52d5\u304f\u304c\u3001\/usr\u306b\u5909\u66f4\n# crontab -e\ncrontab: installing new crontab\n# crontab -l\n* * * * * \/usr\/bin\/certbot renew &amp;&amp; \/bin\/systemctl reload nginx\n\u2192cron\u306e\u6642\u9593\u306f\u5ff5\u306e\u70ba\u30de\u30b9\u30af<\/pre><\/div>\n\n\n\n<p>certbot\u78ba\u8a8d<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:false,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\"># certbot renew\n(\u629c\u7c8b)\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nProcessing \/etc\/letsencrypt\/renewal\/meto4d.pgw.jp.conf\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nCert is due for renewal, auto-renewing...\nCould not choose appropriate plugin: The manual plugin is not working; there may be problems with your existing configuration.\nThe error was: PluginError('An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.')\nFailed to renew certificate meto4d.pgw.jp with error: The manual plugin is not working; there may be problems with your existing configuration.\nThe error was: PluginError('An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.')\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<\/pre><\/div>\n\n\n\n<p>\u30d7\u30e9\u30b0\u30a4\u30f3\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u3066\u3044\u308b\u304b\u3089<code>--manual-auth-hook<\/code>\u3092\u4f7f\u3048\u3068\u306e\u3053\u3068<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><code>certbot certonly --manual --manual-auth-hook \/path\/to\/http\/authenticator.sh --manual-cleanup-hook \/path\/to\/http\/cleanup.sh -d secure.example.com<\/code><\/p><p>This will run the&nbsp;<code>authenticator.sh<\/code>&nbsp;script, attempt the validation, and then run the&nbsp;<code>cleanup.sh<\/code>&nbsp;script. Additionally certbot will pass relevant environment variables to these scripts:<\/p><cite>User Guide \u2014 Certbot 1.15.0.dev0 documentation\u3000https:\/\/certbot.eff.org\/docs\/using.html#pre-and-post-validation-hooks<\/cite><\/blockquote>\n\n\n\n<p>certbot\u306fshell\u5909\u6570\u3092\u8aad\u307f\u53d6\u3063\u3066\u8a8d\u8a3c\u3092\u53d6\u308b<br><code>--manual-auth-hook<\/code>\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u8a8d\u8a3c\u524d\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066\u3001shell\u5909\u6570\u306b\u4ee3\u5165\u2192<code>--manual-cleanup<\/code>\u3067\u5909\u6570\u3092\u524a\u9664<br>\u3068\u3044\u3046\u3053\u3068\u3089\u3057\u3044<br>\u305d\u3082\u305d\u3082certbot\u306f\u30ef\u30f3\u30bf\u30a4\u30e0\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u53d6\u5f97\u3057\u3066\u3001_acme-challenge\u306eTXT\u30ec\u30b3\u30fc\u30c9\u306b\u305d\u306e\u30ef\u30f3\u30bf\u30a4\u30e0\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3001\u305d\u308c\u3092\u8a8d\u8a3c\u5c40\u304c\u78ba\u8a8d\u3057\u3066\u8a8d\u8a3c\u3068\u3044\u3046\u624b\u9806<br>\u305d\u306e\u30ef\u30f3\u30bf\u30a4\u30e0\u30d1\u30b9\u30ef\u30fc\u30c9\u95a2\u4fc2\u3092shell\u5909\u6570\u5468\u308a\u3067\u89e3\u6c7a\u3059\u308b\u3068\u3044\u3046\u3053\u3068<\/p>\n\n\n\n<p>\u3069\u3046\u3082\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u306e\u5834\u5408\u306fAPI\u5148\u3092\u5909\u66f4\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u95a2\u4fc2\u3067\u3001<code>certbot renew<\/code>\u3060\u3051\u3067\u306f\u3060\u3081\u3063\u307d\u3044<br>\u624b\u52d5\u3067\u8a8d\u8a3c\u3092\u53d6\u3089\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3063\u307d\u3044<br>\u3046\u30fc\u3093\u3001\u3081\u3093\u3069\u3046\u304f\u3055\u3044\u2026<\/p>\n\n\n\n<h2>MyDNS\u306eLet&#8217;s Encrypt\u66f4\u65b0\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5c0e\u5165<\/h2>\n\n\n\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001MyDNS\u304c\u516c\u958b\u3057\u3066\u3044\u305fLet&#8217;s Encrypt\u81ea\u52d5\u66f4\u65b0\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5c0e\u5165<br>\u30b9\u30af\u30ea\u30d7\u30c8\u306bPHP\u306f\u3061\u3087\u3063\u3068\u306a\u3042\u3068\u601d\u3063\u3066\u3044\u305f\u304c\u3001\u5b97\u6559\u7684\u306a\u611f\u899a\u306a\u306e\u3067\u3001\u91cd\u3044\u8170\u3092\u4e0a\u3052\u3066\u5c0e\u5165<br>MyDNS\u306eDomainInfo\u306b\u3053\u3046\u3042\u308b<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>3-2)&nbsp;<strong>Let&#8217;s Encrypt\u306e\u30ef\u30f3\u30bf\u30a4\u30e0\u30d1\u30b9\u30ef\u30fc\u30c9\u306b\u3064\u3044\u3066<\/strong><br><br>Let&#8217;s Encrypt\u306e\u30b5\u30fc\u30d0\u30fc\u8a3c\u660e\u66f8\u3092\u53d6\u5f97\u3059\u308b\u969b\u306b\u3001\u30ef\u30f3\u30bf\u30a4\u30e0\u30ad\u30fc\u3092DNS\u60c5\u5831\u306eTXT\u30ec\u30b3\u30fc\u30c9\u306b\u66f8\u304f\u3053\u3068\u3001\u3068\u3044\u3046\u8aac\u660e\u304c\u3042\u308a\u307e\u3059\u304c\u3001MyDNS.JP\u3067\u306f\u5c02\u7528API\u3068\u3001\u305d\u306eAPI\u3092\u4f7f\u3046\u305f\u3081\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/disco-v8\/DirectEdit\/\" target=\"_blank\">GitHUB\u3067\u516c\u958b<\/a>\u3057\u3066\u3044\u307e\u3059\u3002 \u3067\u3059\u306e\u3067\u3001Linux\u3067\u3054\u5229\u7528\u306e\u5834\u5408\u306b\u306f\u3053\u3061\u3089\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5c0e\u5165\u3055\u308c\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3044\u305f\u3057\u307e\u3059\u3002<\/p><cite>\u81ea\u5b85\u30b5\u30fc\u30d0\u30fc\u3084VPS\u306b\u4f7f\u3048\u308b\u7121\u6599\u306e\u30c0\u30a4\u30ca\u30df\u30c3\u30afDNS (Dynamic DNS) https:\/\/www.mydns.jp\/members\/#domaininfo<\/cite><\/blockquote>\n\n\n\n<p><a href=\"https:\/\/github.com\/disco-v8\/DirectEdit\/\">GitHUB\u306b\u3066\u5c02\u7528API\u3092\u53e9\u304fPHP\u30b9\u30af\u30ea\u30d7\u30c8<\/a>\u304c\u7f6e\u304b\u308c\u3066\u3044\u308b<br>\u3054\u4e01\u5be7\u306b\u5c0e\u5165\u65b9\u6cd5\u3082\u66f8\u3044\u3066\u3042\u308b<br>\u304c\u3001\u5c0e\u5165\u901a\u308a\u306ewget\u3067\u306f\u306a\u304f\u3001git clone\u3067\u3068\u3063\u3066\u304f\u308b<br>PHP8\u5bfe\u5fdc\u304c\u631f\u307e\u308b\u3068\u66f4\u65b0\u304c\u5fc5\u8981\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3057\u306d<\/p>\n\n\n\n<p>\u5c02\u7528\u30c7\u30a3\u30ec\u30af\u30c8\u30ea(\/root\/cron\/mydns)\u3092\u4f5c\u3063\u3066\u3001\u305d\u3053\u3067\u4f5c\u696d<br>\u4e0a\u3067\u3061\u3087\u308d\u3063\u3068\u66f8\u3044\u305f\u3051\u3069\u3001root\u4ee5\u5916\u3067\u4f5c\u696d\u3055\u305b\u305f\u3044\u306d<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:false,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\"># php -v\nPHP 8.0.3 (cli) (built: Mar  4 2021 13:26:46) ( NTS )\nCopyright (c) The PHP Group\nZend Engine v4.0.3, Copyright (c) Zend Technologies\n\u2192PHP8\u304c\u3059\u3067\u306barch\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u914d\u5e03\u3055\u308c\u3066\u3044\u305f\n\n# git clone https:\/\/github.com\/disco-v8\/DirectEdit.git\n# ls\nDirectEdit\n# cd DirectEdit\n# ls\nREADME.md  txtdelete.php  txtedit.conf  txtregist.php\n# chmod 700 *.php\n# chmod 600 *.conf\n# vim txtedit.conf\n\u2192mydns\u306eID\u3084\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\n\u2192yourdomain\u306f\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u624b\u524d\u306e\u30b5\u30d6\u30c9\u30e1\u30a4\u30f3\u307e\u3067\n\u2192 *.meto4d.pgw.jp\u3067\u3042\u308c\u3070meto4d.pgw.jp\n# certbot certonly --manual \\\n--preferred-challenges=dns \\\n--manual-auth-hook \/your\/domain\/directory\/DirectEdit-master\/txtregist.php \\\n--manual-cleanup-hook \/your\/domain\/directory\/DirectEdit-master\/txtdelete.php \\\n-d meto4d.pgw.jp -d *.meto4d.pgw.jp \\\n--server https:\/\/acme-v02.api.letsencrypt.org\/directory \\\n--agree-tos -m hogehoge@hoge \\\n--manual-public-ip-logging-ok\n\nUse of --manual-public-ip-logging-ok is deprecated.\nSaving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\nPlugins selected: Authenticator manual, Installer None\nUse of --manual-public-ip-logging-ok is deprecated.\nCert not yet due for renewal\n\nYou have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.\n(ref: \/etc\/letsencrypt\/renewal\/meto4d.pgw.jp.conf)\n\nWhat would you like to do?\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n1: Keep the existing certificate for now\n2: Renew &amp; replace the certificate (may be subject to CA rate limits)\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nSelect the appropriate number [1-2] then [enter] (press 'c' to cancel): 2\nRenewing an existing certificate for meto4d.pgw.jp and *.meto4d.pgw.jp\n\nIMPORTANT NOTES:\n - Congratulations! Your certificate and chain have been saved at:\n   \/etc\/letsencrypt\/live\/meto4d.pgw.jp\/fullchain.pem\n   Your key file has been saved at:\n   \/etc\/letsencrypt\/live\/meto4d.pgw.jp\/privkey.pem\n   Your certificate will expire on 2021-08-01. To obtain a new or\n   tweaked version of this certificate in the future, simply run\n   certbot again. To non-interactively renew *all* of your\n   certificates, run &quot;certbot renew&quot;\n - If you like Certbot, please consider supporting our work by:\n\n   Donating to ISRG \/ Let's Encrypt:   https:\/\/letsencrypt.org\/donate\n   Donating to EFF:                    https:\/\/eff.org\/donate-le<\/pre><\/div>\n\n\n\n<p><a href=\"https:\/\/auto.meto4d.pgw.jp\/blog\/?p=52\">\u524d\u56de(Let\u2019s Encrypt \u3067SSL\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u8a3c\u660e\u66f8\u3092\u5c0e\u5165\u3059\u308b)<\/a>\u3067\u767b\u9332\u3057\u3066\u3044\u305f\u304c\u3001<code>certbot certonly<\/code>\u3067\u3082renew\u52d5\u4f5c\u3068\u540c\u3058\u3088\u3046\u306b\u66f4\u65b0\u4e0a\u66f8\u304d\u3057\u3066\u304f\u308c\u308b<br>\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u304d\u306a\u304c\u3089\u5b9f\u65bd\u3059\u308b\u524d\u306b\u3001\u30c6\u30b9\u30c8\u3067\u524d\u56de\u3068\u540c\u69d8\u306e<code>certbot certonly<\/code>\u3067TXT\u30ec\u30b3\u30fc\u30c9\u3092\u66f4\u65b0\u3057\u3066\u3001\u4e91\u3005\u3092\u5b9f\u65bd\u3057\u3066\u3044\u305f\u306e\u3067\u3001\u8a3c\u660e\u66f8\u304c\u66f4\u65b0\u6e08\u307f<br>\u305d\u308c\u3067\u3082\u66f4\u65b0\u3059\u308b\u304b\u3057\u306a\u3044\u304b\u3092\u805e\u304b\u308c\u3066\u3044\u308b<br><code>Use of --manual-public-ip-logging-ok is deprecated.<\/code>\u3068\u8a00\u308f\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u308c\u306f\u5f8c\u3067\u4fee\u6b63\u3057\u3088\u3046<\/p>\n\n\n\n<p>\u3053\u308c\u3067OK<br>\u3042\u3068\u306f<code>systemctl reload nginx<\/code>\u3067\u8aad\u307f\u8fbc\u3093\u3067\u3044\u308b\u8a3c\u660e\u66f8\u3092\u66f4\u65b0<\/p>\n\n\n\n<h3>Cron\u767b\u9332\u7528\u306eshellscript\u3092\u4f5c\u308b<\/h3>\n\n\n\n<p>\u4e0a\u306e\u66f4\u65b0\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u843d\u3068\u3057\u8fbc\u3093\u3067cron\u306b\u767b\u9332\u3057\u3066\u3084\u308b<br>\u30b3\u30fc\u30c9\u8868\u793a\u7528\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u305b\u3044\u306a\u3093\u3060\u304c\u3001\u4e0a\u306fshellscript\u3067\u4e0b\u306f\u305d\u308c\u3092\u5b9f\u65bd\u3057\u305f\u3068\u304d\u306e\u30b3\u30de\u30f3\u30c9<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:false,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Shell - certbot.mydns.sh&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">#!\/bin\/bash\nif test $# -eq 0 ; then\n  INPUT=1\nelse\n  if test $1 -eq 1 || test $1 -eq 2; then\n    INPUT=$1\n  else\n    INPUT=1\n  fi\nfi\n\necho $INPUT | \/usr\/bin\/certbot certonly --manual --preferred-challenges=dns --manual-auth-hook \/root\/cron\/mydns\/DirectEdit\/txtregist.php --manual-cleanup-hook \/root\/cron\/mydns\/DirectEdit\/txtdelete.php -d meto4d.pgw.jp -d *.meto4d.pgw.jp --server https:\/\/acme-v02.api.letsencrypt.org\/directory --agree-tos -m hogehoge@hoge<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:false,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\"># chmod 700 certbot.mydns.sh\n# certbot.mydns.sh 1\nSaving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\nPlugins selected: Authenticator manual, Installer None\nCert not yet due for renewal\n\nYou have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.\n(ref: \/etc\/letsencrypt\/renewal\/meto4d.pgw.jp.conf)\n\nWhat would you like to do?\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n1: Keep the existing certificate for now\n2: Renew &amp; replace the certificate (may be subject to CA rate limits)\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nSelect the appropriate number [1-2] then [enter] (press 'c' to cancel): Keeping the existing certificate\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nCertificate not yet due for renewal; no action taken.\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nSaving debug log to \/var\/log\/letsencrypt\/letsencrypt.log<\/pre><\/div>\n\n\n\n<p>\u3061\u3083\u3093\u3068\u52d5\u4f5c\u3057\u3066\u3044\u308b\u307f\u305f\u3044\u3060<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:false,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\"># crontab -l\n* * * * * \/root\/cron\/mydns\/DirectEdit\/certbot.renew.mydns.sh 1; \/usr\/bin\/certbot renew &amp;&amp; \/bin\/systemctl reload nginx<\/pre><\/div>\n\n\n\n<p>\u5b9a\u671f\u66f4\u65b0\u306e\u6642\u9593\u306fmask\u3057\u3066\u308b\u305b\u3044\u3067\u6bce\u5206\u5b9f\u65bd\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u898b\u3048\u308b\u304c\u5b9f\u969b\u306f\u9055\u3046<br>\u3068\u306f\u3044\u3048\u3001\u7bc4\u56f2\u3067\u6307\u5b9a\u3057\u3066\u3044\u308b<br><code>certbot renew<\/code>\u306f\u66f4\u65b0\u306a\u304fskipped\u3067\u3082\u6b63\u5e38\u7d42\u4e86\u3067\u7d42\u308f\u308b\uff08\u3068\u3044\u3046\u3053\u3068\u3092\u4eca\u77e5\u3063\u305f\uff09<br>\u2192systemctl reload nginx\u304c\u52dd\u624b\u306b\u631f\u307e\u3063\u3066\u3057\u307e\u3046<br>\u3053\u308c\u306f\u306a\u3093\u3068\u304b\u3057\u305f\u3044\u306d<br>\u4e0d\u7528\u610f\u306bnginx\u304c\u518d\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3057\u307e\u3046\u3002<\/p>\n\n\n\n<p>\u307e\u3042\u3001\u3053\u308c\u306fv6.meto4d.pgw.jp\u304c6\/30\u306b\u5207\u308c\u308b\u3089\u3057\u3044\u306e\u3067\u3001\u305d\u306e\u66f4\u65b0\u3092\u624b\u52d5\u3067\u884c\u3063\u3066\u3001\u8a3c\u660e\u66f8\u66f4\u65b0\u304c\u3042\u3063\u305f\u3068\u304d\u306e\u6587\u5b57\u5217\u3092\u898b\u308b\u2192grep\u3068\u304b\u3067\u63a2\u3057\u3066\u3042\u308c\u3070\u66f4\u65b0\u306b\u3057\u3088\u3046<br>cron\u306f\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u3001\u3082\u3046\u4e00\u5ea6\u30a2\u30e9\u30fc\u30c8\u30e1\u30fc\u30eb\u3092\u53d7\u3051\u53d6\u308b\u3088\u3046\u306b\u3057\u3066\u4eca\u65e5\u306f\u7d42\u4e86\u3002<\/p>\n\n\n\n<h2>\u4f59\u8ac7\uff1a\u66f4\u65b0\u3059\u308bPHP\u306e\u4e2d\u8eab<\/h2>\n\n\n\n<p>DirectEdit\/txtregist.php at master \u00b7 disco-v8\/DirectEdit \u00b7 GitHub https:\/\/github.com\/disco-v8\/DirectEdit\/blob\/master\/txtregist.php<br><\/p>\n\n\n\n<p>\u5358\u7d14\u306bcertbot\u304b\u3089\u3084\u3063\u3066\u304f\u308b\u53ef\u80fd\u6027\u306e\u3042\u308b\u5909\u6570\u3092\u914d\u5217\u306b\u5165\u308c\u3066\u3001MyDNS\u3078\u30af\u30a8\u30ea\u3092\u98db\u3070\u3057\u3066\u3044\u308b\u3060\u3051\u3060\u3063\u305f<br>Python\u3068\u304bRuby\u3068\u304b\u3082\u3046\u5c11\u3057\u7ba1\u7406\u3057\u3084\u3059\u3044\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u66f8\u304d\u63db\u3048\u3066\u3001\u305d\u3063\u3061\u3067\u7ba1\u7406\u3057\u3066\u3082\u3044\u3044\u304b\u3082\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de(Let\u2019s Encrypt \u3067SSL\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u8a3c\u660e\u66f8\u3092\u5c0e\u5165\u3059\u308b)\u306e\u7d9a\u304d\uff1fMyDNS\u304c\u516c\u958b\u3057\u3066\u3044\u308bPHP\u306escript\u3092\u5c0e\u5165\u3057\u3066\u3001renew\u304c\u884c\u3048\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,13,5],"tags":[],"views":7980,"_links":{"self":[{"href":"https:\/\/auto.meto4d.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/143"}],"collection":[{"href":"https:\/\/auto.meto4d.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/auto.meto4d.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/auto.meto4d.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/auto.meto4d.pgw.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=143"}],"version-history":[{"count":12,"href":"https:\/\/auto.meto4d.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions"}],"predecessor-version":[{"id":242,"href":"https:\/\/auto.meto4d.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions\/242"}],"wp:attachment":[{"href":"https:\/\/auto.meto4d.pgw.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/auto.meto4d.pgw.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/auto.meto4d.pgw.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}