Letsencrypt is what we use to generate our SSL certificates (allows for HTTPS usage). Below are instructions using certbot to generate your certificates.
Each domain has a line as
-d domain.com within the command. You can add more domains by simply adding a listing in that format and executing the command all at once.
Running this command will get a certificate for you and have Certbot edit your Apache (specified with the option “–apache”) configuration automatically to serve it. The option “–redirect” will set the domain to redirect HTTP to HTTPS.
To generate certificates, execute the commands below:
sudo /usr/local/bin/certbot-auto --apache --redirect -d domain.tld
cd /usr/local/letsencrypt && ./letsencrypt-auto --apache --redirect -d example.com -d www.example.com
sudo certbot --apache --redirect -d example.com -d www.example.com
The packages on your system come with a cron job that will renew your certificates automatically before they expire. Since Let’s Encrypt certificates last for 90 days, it’s highly advisable to take advantage of this feature. Run the command below to execute this (add the option “–dry-run” to test first):
cd /usr/local/letsencrypt && ./letsencrypt-auto renew
sudo certbot renew
If you need to delete a certificate, the best way is to use the command below (a manual deletion will not remove the link to that certificate as it is recorded in LetsEncrypt):
cd /usr/local/letsencrypt && ./certbot-auto delete --cert-name example.com
sudo certbot delete --cert-name example.com