[Resolved] Issue to renew 2 certs on the same server

I just build a new server to replace an old one (hardware change).
I use the letsencrypt and certbot Debian packages and I’m trying to test a renew of my 2 certs using certbot.

I have 2 virtual hosts : cabinet-gouraud.fr and mail.cabinet-gouraud.fr and I I’d like to renew both certs (the live ones are currently working).
I add into the LE config 2 scripts in pre and post-hook to start and stop apache.
When I run certbot, it seems thats the first cert renewal works but not the second one.
I feel it is because the process try to renew the second cert while apache has been stopped.
Is there any way to renew both certs with only one stop/star apache ?
(I also tried : certbot --apache -d cabinet-gouraud.fr -d mail.cabinet-gouraud.fr --pre-hook “service apache2 stop” --post-hook “service apache2 start” but still same issue.

As I’m absolutely not familiar with LE and SSL mechanisms, any help would be appreciated.
Many thanks.

PhiL

My domain is: cabinet-gouraud.fr and mail.cabinet-gouraud.fr

I ran this command: certbot renew --dry-run

It produced this output:
Attempting to renew cert (cabinet-gouraud.fr) from /etc/letsencrypt/renewal/cabinet-gouraud.fr.conf produced an unexpected error: Problem binding to port 80: Could not bind to IPv4 or IPv6… Skipping.
The following certs could not be renewed:
/etc/letsencrypt/live/cabinet-gouraud.fr/fullchain.pem (failure)

My web server is (include version): apache v2.4.25

The operating system my web server runs on is (include version): Debian 9.12 (stretch)

My hosting provider, if applicable, is: OVH

I can login to a root shell on my machine (yes or no, or I don’t know): Yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): certbot 0.28.0

1 Like

What about certbot renew --apache --dry-run?

1 Like

It works !!!
I can’t believe it was so simple and I get pass thru.
It looks evident now.
So I can go to renew the live ones now but I’m pretty sure it willl be OK :wink:
Many thanks 9peppe
PhiL

1 Like

Solutions are simple, diagnostic is not.

Your certbot was trying to use --standalone, and that doesn’t work when there’s a webserver on port 80, in that case you need to use --apache, --nginx, or --webroot.

1 Like

Thanks also for explains.

1 Like

Confirmed : Works like a charm on live certs :partying_face:

1 Like

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