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/ </VirtualHost>
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.