Renew certificat

Dear,

I generate certificats for my domains byu runnig the command :
certbot certonly -w /home/sitexxx/web/www -d example1.com -d www.example1.com
certbot certonly -w /home/sitexxx/web/www -d example2.com -d www.example2.com
certbot certonly -w /home/sitexxx/web/www -d example3.com -d www.example3.com

To renew all domain in one time
can I launch the command
certbot renew

Yes,

using “certbot renew” will check and renew any certificates that are due for renewal

And do i need to restart apache?

You will need to reload apache, yes ( reload is "nicer" than restart - as it does it gracefully and doesn't stop existing connections). I'd suggest using the "--renew-hook" command which will only be run if a certificate is renewed e.g.

certbot renew --renew-hook "service apache2 reload"

1 Like

thanks.

I was thinking to a
`service apache2 graceful
but i think reload are even better

And I guess I can add in a crontab
00 2 * * 1 /usr/local/sbin/certbot renew --renew-hook "service apache2 reload" >> /var/log/le-renew.log

Yes you can.

Personally I run it daily, rather than weekly as you have in that cron (since certbot checks the certs and only renews them when they are within 30 days of expiry, there is no downside to running it daily )

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.