My current go-to script(s) for handling SSL Cert renewal through AWS Lightsail.
“My current goto script(s) to handle SSL Cert renewal through Lightsail”.
sudo /opt/bitnami/letsencrypt/lego --path /opt/bitnami/letsencrypt list
sudo certbot certificates
sudo /opt/bitnami/letsencrypt/lego --tls --email="EMAIL-ADDRESS" --domains="DOMAIN" --path="/opt/bitnami/letsencrypt" renew --days 90
sudo /opt/bitnami/ctlscript.sh start
OR
DOMAIN=aetrius.dev
WILDCARD=*.$DOMAIN
sudo certbot -d $DOMAIN -d $WILDCARD --manual --preferred-challenges dns certonly
sudo /opt/bitnami/ctlscript.sh stop
sudo mv /opt/bitnami/apache2/conf/bitnami/certs/server.crt /opt/bitnami/apache2/conf/bitnami/certs/server.crt.old
sudo mv /opt/bitnami/apache2/conf/bitnami/certs/server.key /opt/bitnami/apache2/conf/bitnami/certs/server.key
sudo ln -sf /etc/letsencrypt/live/$DOMAIN/privkey.pem /opt/bitnami/apache2/conf/bitnami/certs/server.key
sudo ln -sf /etc/letsencrypt/live/$DOMAIN/fullchain.pem /opt/bitnami/apache2/conf/bitnami/certs/server.crt
sudo /opt/bitnami/ctlscript.sh start
Objective, let’s create a script that will handle the existing cert setup and auto renew on schedule.
Resources: https://repost.aws/knowledge-center/lightsail-bitnami-renew-ssl-certificate
Leave a Reply