Certbot does not recognise vhosts/web roots but they resolve

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: mikegoodmanphoto.com
It resolves in FF as does www.mikegoodmanphoto.com
Checked DNS, vhosts file, web root, all good.

I ran this command: certbot -v --apache after a failure without the -v

It produced this output: `~]# certbot -v --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Please enter the domain name(s) you would like on your certificate (comma and/or
space separated) (Enter 'c' to cancel): mikegoodmanphoto.com www.mikegoodmanphoto.com
Requesting a certificate for mikegoodmanphoto.com and www.mikegoodmanphoto.com
Performing the following challenges:
http-01 challenge for mikegoodmanphoto.com
http-01 challenge for www.mikegoodmanphoto.com
Cleaning up challenges
Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

My web server is (include version): Alma Linux v9

The operating system my web server runs on is (include version): Linux 5.14.0-362.24.2.el9_3.x86_64

My hosting provider, if applicable, is: self-managed remote VPS provided by RackNerd

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 2.0.9

That sounds like you do not have a dedicated VirtualHost for that domain and port 80.

What does this show?

sudo httpd -t -D DUMP_VHOSTS

You might need apachectl or even apache2ctl instead of httpd in that command.
I am not sure with Alma which it is

2 Likes

Hello @photoboss, welcome to the Let's Encrypt community. :slightly_smiling_face:

Kindly wait for more knowledgeable Let's Encrypt community volunteers to assist.

Supplemental information to assist others in debugging.

Here is a list of issued certificates crt.sh | mikegoodmanphoto.com, the latest being 2024-04-01.
However the presently being served certificate is https://decoder.link/sslchecker/mikegoodmanphoto.com/443 which is self-signed and only contains the name mikegoodmanphoto.com.

Using the online tool Let's Debug show OK for both mikegoodmanphoto.com and www.mikegoodmanphoto.com here
https://letsdebug.net/mikegoodmanphoto.com/1867643
and here
https://letsdebug.net/www.mikegoodmanphoto.com/1867649

$ curl -Ii http://mikegoodmanphoto.com/.well-known/acme-challenge/sometestfile
HTTP/1.1 404 Not Found
Date: Thu, 11 Apr 2024 21:45:02 GMT
Server: Apache/2.4.57 (AlmaLinux) OpenSSL/3.0.7
Content-Type: text/html; charset=iso-8859-1
$ curl -Ii http://www.mikegoodmanphoto.com/.well-known/acme-challenge/sometestfile
HTTP/1.1 404 Not Found
Date: Thu, 11 Apr 2024 21:45:08 GMT
Server: Apache/2.4.57 (AlmaLinux) OpenSSL/3.0.7
Content-Type: text/html; charset=iso-8859-1
1 Like

Solved. A typo in the name of the vhost file. Corrected and the cert now issued.

@MikeMcQ thanks for the response. It had me scratching my head as I had written the following in the OP, and the vhosts file itself is indeed good. However, double checking to make sure everything was in the right place did at least help me spot the error.

2 Likes

Thanks for all that info. Yes, I was trying to build on a shared hosting space in the USA that didn't work out. I'm now on a VPS in France so building anew.

2 Likes