Let’s Encrypt更新時のWarningの対処

セキュリティー

WARNING: couldn’t find Python 2.7+ to check for updates.
/usr/local/sbin/certbot-auto: line 878: python3: command not found

SCLのインストール

SCLは、古い CentOS で新し目のライブラリを使うためのしかけ
OSが主として利用するライブラリはそのまま残し、
バージョンが新しいライブラリが必要になってきた場合のみにライブラリを有効
にする仕組み。

CentOS6 の yum は python 2.6 を使用しているので、
勝手にバージョンアップしてしまうとyumが動かなくなるので注意が必要です。。

# yum install centos-release-scl
# yum install python27 python27-python-tools

確認

# python -V
Python 2.6.6

# scl enable python27 bash
# python -V
Python 2.7.8
# exit

# python -V
Python 2.6.6

cronで使うには

自動更新はたいていの場合、cronで設定しますが、
cronで実行される場合はまだpython2.7が有効になっていません。
cronでpython2.7を有効にするには
crontabでコマンドの頭に「scl enable python27」を追記します。

02 02 10 * * scl enable python27 "/usr/local/sbin/certbot-auto renew --force-renew && /etc/init.d/httpd graceful" > /tmp/certbot.log 2>&1



タイトルとURLをコピーしました