AWSのEC2(Amazon Linux)において、Let’s Encryptの証明書更新がImportErrorで失敗する
=== 症状 ===
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$ /usr/local/letsencrypt/certbot-auto renew Creating virtual environment... Installing Python packages... Installation succeeded. Requesting root privileges to run certbot... /home/ec2-user/.local/share/letsencrypt/bin/letsencrypt renew Traceback (most recent call last): File "/home/ec2-user/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module> from certbot.main import main File "/home/ec2-user/.local/share/letsencrypt/local/lib/python2.7/dist-packages/certbot/main.py", line 12, in <module> import zope.component File "/home/ec2-user/.local/share/letsencrypt/local/lib/python2.7/dist-packages/zope/component/__init__.py", line 16, in <module> from zope.interface import Interface ImportError: No module named interface |
=== 解決策 ===
1. 環境変数 PYTHON_INSTALL_LAYOUT をunsetする
1 |
$ unset PYTHON_INSTALL_LAYOUT |
2. letsencryptをアップデートする
1 |
$ sudo /usr/local/letsencrypt/certbot-auto -v |
3. 証明書を更新する
1 |
$ sudo /usr/local/letsencrypt/certbot-auto renew |
4. Apache2を再起動する
1 |
$ sudo /etc/init.d/httpd restart |
=== 注意 ===
2016年5月にコマンドラインツール名が "letsencrypt-auto" から "certbot-auto" へ変更。