LoginSignup
0
0

AmazonLinux 2023でcertbotを用いてhttps化するときのコマンド

Posted at

certbot導入からhttps化するまで

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

#自動更新
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

とりあえずこれでできた。
certbotの入れ方はいろいろ試したがこれでしかできなかった

0
0
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
0
0