LoginSignup
2
1

More than 1 year has passed since last update.

Amazon Linux 2023 にcertbotを入れる(2023年5月時点)

Posted at

はじめに

Amazon Linux 2023 ではEPELがサポートされていません。
Amazon Linux 2 でEPELからCertbotを入れていた場合、移行時の問題になります。
現時点では、Cerbotの公式ドキュメントに記載されているpipを利用した導入を行うことになります。

※説明例は、nginxでの利用の場合です。

手順

# 必要パッケージインストール
dnf install python3 augeas-libs cronie

# venv作成・pipからcertbotをインストール
python3 -m venv /opt/certbot/
/opt/certbot/bin/pip install --upgrade pip
/opt/certbot/bin/pip install certbot certbot-nginx
ln -s /opt/certbot/bin/certbot /usr/bin/certbot

# 証明書取得
certbot certonly --nginx -d example.com --dry-run
certbot certonly --nginx -d example.com

# 自動更新の登録
crontab -e
crontabで追記する内容
0 0,12 * * * root /opt/certbot/bin/python -c 'import random; import time; time.sleep(random.random() * 3600)' && sudo certbot renew -q

さいごに

cronも標準で入ってなくておどろき。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1