0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

bitnamiにCertbot-auto入れるときのメモ

Last updated at Posted at 2020-10-09

しょっちゅう忘れるのでメモ

Rootユーザーになる
sudo su -

ドメインを環境変数に
DOMAIN=sample.com

certbotをインストール
apt-get -y install letsencrypt python-letsencrypt-apache

パスが通ってるか確認
which certbot-auto

証明書発行(WordPressの場合)
certbot-auto certonly --webroot -w /opt/bitnami/apps/wordpress/htdocs -d $DOMAIN

シンボリックリンク

ln -s /etc/letsencrypt/live/$DOMAIN/privkey.pem /opt/bitnami/apache2/conf/server.key
ln -s /etc/letsencrypt/live/$DOMAIN/fullchain.pem /opt/bitnami/apache2/conf/server.crt```

apache再起動
```/opt/bitnami/ctlscript.sh restart apache```

cron設定
```crontab -e
0 0 * * 1 /usr/bin/certbot-auto renew --deploy-hook "/opt/bitnami/ctlscript.sh restart apache"```
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?