Unable to find a virtual host listening on port 80

Hi,

I’ve read other posts for the “Unable to find a virtual host listening on port 80” error, but my issue seems to be different.

Since certbot isn’t autorenewing, I run

sudo certbot renew --dry-run

and I get “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.”

Following other threads, I ran

apachectl -t -D DUMP_VHOSTS

and it gives me:

VirtualHost configuration:
*:443 example-dev-vm.c.shs-server.internal (/etc/apache2/sites-enabled/default-ssl.conf:2)

So, default-ssl.conf contains (comments and unused code edited out):

<IfModule mod_ssl.c>
	<VirtualHost _default_:443>
		ServerAdmin webmaster@localhost

 <Directory /var/www/html/>
 Options Indexes FollowSymLinks MultiViews
 AllowOverride All
 Order allow,deny
 allow from all
 </Directory>

DocumentRoot /var/www/html

SSLEngine on

 SSLCertificateFile "/etc/letsencrypt/live/example.com/cert.pem"
 SSLCertificateKeyFile "/etc/letsencrypt/live/example.com/privkey.pem"
 SSLCertificateChainFile "/etc/letsencrypt/live/example.com/chain.pem"

		<FilesMatch "\.(cgi|shtml|phtml|php)$">
				SSLOptions +StdEnvVars
		</FilesMatch>

		<Directory /usr/lib/cgi-bin>
				SSLOptions +StdEnvVars
		</Directory>

	</VirtualHost>
</IfModule>

Do I add a <VirtualHost *:80> in the default-ssl.conf file?

Running:
Debian 9
Apache 2.4
Certbot 0.28.0-1~deb9u2

1 Like

Hi @bluedogranch

please read your output. There is no port 80 vHost, there is only a port 443 vHost. That’s your error message - create a working port 80 vHost.

Why do you want to create a port 80 (non-ssl) vHost in a file named ssl.conf?

1 Like

I don’t know if I need it in ssl.conf. If not there, where do I create a port 80 vhost?

There are no VirtualHosts set up in apache2.conf.

ports.conf contains

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
	Listen 443
</IfModule>

<IfModule mod_gnutls.c>
	Listen 443
</IfModule>
1 Like

So where is everyone?

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