ばかやろう。
ajicolor.hatenablog.jp
ajicolor.hatenablog.jp
同じ失敗を何度でも繰り替えす学習能力なし子ちゃん
# /root/certbot-auto certonly --webroot -w /var/www/html/domain1 -d domain1.com -d mail.domain1.com -w /var/www/html/domain2 -d domain2.com -w /var/www/html/domain3 -d domain3.com
証明書取り直し、慣れたもんですよ。もう。
# service httpd restart
で?(半ギレ)
効かなかった設定
- /etc/cron.d/letsencrtpt
0 1 1 * * root /home/homepage/certbot-auto renew --post-hook "service httpd restart"
そもそもcronは動いてるんか?
# service crond status crond (pid 22704) is running...
あっハイ……
cronってのは結局どこに書くのが正しいんや?
- /var/spool/cron/root
- 中身は空だった
- /etc/cron.d/letsencrypt
- 役に立たなかったのでいったん中身を消去。クソが…
- /etc/crontab
- 中身こんな感じだった
SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # For details see man 4 crontabs # Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * user-name command to be executed
なに???怖いんだけど
ちょっと一旦落ち着いて、ドライランしてみよう
/root/certbot-auto renew --force-renew --dry-run --post-hook "service httpd restart"
普通にできた
結局やっぱり/etc/cron.d/内のファイルに書いとくのが良さそうじゃない?
書き方がまずかったのでは?
- /etc/cron.d/letsencrypt
0 1 1 * * root /home/homepage/certbot-auto renew --post-hook "service httpd restart"
ん?
certbot-auto のパスちがくね??
0 4 5 * * root /root/certbot-auto renew --force-renew --post-hook "service httpd restart"
これで!!!!!
どうだ!!!!
(あと、末尾に改行を入れないと実行されないという噂を聞いたのでしっかり改行をしたぞ!)
こちらの記事を見習って、今月5日(3日後)に強制更新させてみます
続報
cronは動きましたか?
# cat /var/log/cron |grep certbot Dec 5 04:00:01 xxx-xxx-xx CROND[xxxxx]: (root) CMD (/root/certbot-auto renew --force-renew --post-hook "service httpd restart")
お!動いたっぽいぞ
# ls -l /etc/letsencrypt/archive/domain1.com/ total 16 -rw-r--r-- 1 root root 1988 Dec 2 18:12 cert1.pem -rw-r--r-- 1 root root 1647 Dec 2 18:12 chain1.pem -rw-r--r-- 1 root root 3635 Dec 2 18:12 fullchain1.pem -rw-r--r-- 1 root root 1704 Dec 2 18:12 privkey1.pem
んんん・・・?おお・・・?新しいファイルができていない?????
#cat /var/log/httpd/error_log
Apacheが再起動した形跡もないっぽいな・・・・・・
・・・・・・・・・・
・・・・・
〜続く〜