https://andrewbaker.ninja/wp-content/themes/twentysixteen/fonts/merriweather-plus-montserrat-plus-inconsolata.css

πŸ‘0views
Linux: Automatically renew your certs for a wordpress site using letsencrypt

CloudScale SEO — AI Article Summary
What it isThis article explains how to set up automatic SSL certificate renewal for WordPress sites using Let's Encrypt by creating a bash script and scheduling it with cron.
Why it mattersManual certificate renewal every 90 days is tedious and risky - forgetting to renew causes your website to show security warnings and lose visitor trust.
Key takeawayUse a cron job to automatically run the Let's Encrypt renewal command so your SSL certificates stay current without manual intervention.

If you want to automatically renew your certs then the easiest way is to setup a cron just to call letsencrypt periodically. Below is an example cron job:

First create the bash script to renew the certificate

$ pwd
/home/bitnami
$ sudo nano renew-certificate.sh

Now enter the script in the following format into nano:

#!/bin/bash

sudo /opt/bitnami/ctlscript.sh stop apache
sudo /opt/bitnami/letsencrypt/lego --path /opt/bitnami/letsencrypt --email="[email protected]" --http --http-timeout 30 --http.webroot /opt/bitnami/apps/letsencrypt --domains=andrewbaker.ninja renew --days 90
sudo /opt/bitnami/ctlscript.sh start apache

Now edit the crontab to run the renew script:

$ crontab -e
0 0 * * * sudo /home/bitnami/renew-certificate.sh 2> /dev/null

Leave a Reply

Your email address will not be published. Required fields are marked *