acme.sh --install-cert -d dom.ru --cert-file /etc/nginx/acme.sh/dom.ru/dom.ru.pem --key-file /etc/nginx/acme.sh/dom.ru/key.pem --fullchain-file /etc/nginx/acme.sh/dom.ru/fullchain.pem
...
...
...
-----END CERTIFICATE-----
[Wed Oct 12 16:54:54 +03 2022] Your cert is in: /var/db/acme/certs/dom.ru/dom.ru.cer
[Wed Oct 12 16:54:54 +03 2022] Your cert key is in: /var/db/acme/certs/dom.ru/dom.ru.key
[Wed Oct 12 16:54:54 +03 2022] The intermediate CA cert is in: /var/db/acme/certs/dom.ru/ca.cer
[Wed Oct 12 16:54:54 +03 2022] And the full chain certs is there: /var/db/acme/certs/dom.ru/fullchain.cer
Let's say there will be more than 10 certificates.
I don't understand how to automate this process.
Checks for certificate updates every 7 days.
With certbat, I just added in cron script 20 7 */7 * * sh /root/letsencrypt_update
That command can fail through no fault of your own.
Once per week means you are 4 failures from serving an expired certificate. Twice per day makes it 60 failures -- three, as in my example, makes it 90 failures.
I run certificate updates under the normal user acme.
Under the acme user, it will not be possible to reload nginx.
If the certificate has been updated, then create a file. --reloadcms "touch /var/db/acme/.restart_nginx"
further cron from under the root user, we check the creation of the file (/var/db/acme/.restart_nginx), and after a soft reboot of nginx.
root script cron
#!/bin/sh
if [ -f /var/db/acme/.restart_nginx ]; then
service nginx reload
rm -rf /var/db/acme/.restart_nginx
fi
cron acme
Check the certificate 2 times a day.
cron root
Check the file (/var/db/acme/.restart_nginx) in the same way, 2 times a day.