Unable to find Virtual Host Listening on port 80

I keep having an issue where whenever I run certbot that there is an issue. The following error: 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. This is an Amazon Linux 2023 instance.

The first time I had the problem I create a file in /etc/httpd/conf.d called katboose.com and entered the following : `

<VirtualHost *:80>
        ServerName katboose.com
        Redirect / https://katboose.com/

I tried again and the same thing happed ( I restarted apache in between). So, I ran sudo httpd -t -D DUMP_VHOSTS and got VirtualHost configuration: *:443 ec2-IP.compute-1.amazonaws.com (/etc/httpd/conf.d/ssl.conf:56)

I was confused that port 80 wasn't showing up when I just did it.
I thought maybe it had to do with port 443, but it confused because I did not run into this problem with my other instance. All I had to change on my previous instance was the virtual host as I posted above.

I went to the /etc/httpd/conf.d/ssl.conf:56 and I tried changing the stand in [www.example.com] with my actual domain and unhashed it. I still get the same port 80 problem.

Hi @dhmaras, and welcome to the LE community forum :slight_smile:

This seems like an Apache problem - not a certbot, nor a certificate, problem.
But it might be simple to overcome...

Try changing the name from: "katboose.com" to: "katboose.com.conf"
And then restart/reload httpd [Apache].

Then rety:
sudo httpd -t -D DUMP_VHOSTS


@dhmaras To explain why that will likely fix your problem you should review any include statement in your httpd.conf. It likely is limited to files ending in .conf


Such a simple problem that I overlooked. Thank you so much!


I take it file rename did the trick?
If so, cheers :beers:
If not, please explain.


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