This is an old revision of the document!
Table of Contents
SSL certs renewal certonly (no acme-challenge)
FIRST THING
BACKUP THE EXISTENT CERTS (in /etc/servicepattern/)
In case anything goes wrong, you will reuse the old certs.
To install certbot:
yum install -y certbot-nginx
Istances that need certs for operation
* Frankfurt
- Prod5_Core1
- Prod5_Core2
- BeCloud5x
- Monitor
- Support
- Be360(s)
(There are shared Outlook calendars for all expiring certs)
Commands
Certbot single istances
certbot certonly --nginx
Certbot clusters
For clusters, you need to run the command on both istances, but first you have to modify the “weight” of the domain. Login to AWS DNS and select the desired Hosted Zone.
Clusters have shared domain between two machines (for example, Prod5_Core1 and Prod5_Core2 are both pointed by *beincontact.becloudsolutions.com*), to change the weight select one of the two record entry, on the left panel click “Edit record”, change the param “Weight” from 100 to 0, then save.
You have to do this for the machine where you are not trying to renew the certificates (for example, you want to renew Prod5_Core1, change the param of Prod5_Core2, renew the 1 and then convert everything to renew the 2), then restore the weight and repeat the process for the second server.
certbot certonly --nginx -d **domain** -d **domain** *etc*
Certbot not installed
./certbot-auto certonly --nginx
(if you don't find the script you can locate it with find / -iname certbot-auto)
Follow the wizard and read the final output, you need to cd into the directory of the certificate before running
the commands to preare the certs (will be in /etc/letsencrypt/live/)
Certs preparation
cp privkey.pem server.key cat fullchain.pem | cat - privkey.pem > server.pem \cp -b server.key /etc/servicepattern/ \cp -b server.pem /etc/servicepattern/
Restart services
systemctl restart nginx && systemctl restart agentserver
— Lorenzo Cesana 2024/03/14 16:55
