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

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. https://crt.sh/?q=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: carglasspart.com

I ran this command: certbot certonly -w /var/www/html -d domain.com

It produced this output: 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.

My web server is (include version): Ubuntu 22.04

The operating system my web server runs on is (include version): Linux Ubuntu

My hosting provider, if applicable, is: Amazon Web server

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 1.21.0

I saw your previous thread. Are you able to run a command like this yet?

sudo apachectl -t -D DUMP_VHOSTS

the outout of this command is
sudo apachectl -t -D DUMP_VHO

VirtualHost configuration:

With the above command you must have chosen the Apache plug-in. And, that requires a VirtualHost config for Apache. The Ubuntu website has a good overview of how to do this in their setup (link here).

But, it looks like you wanted to use --webroot because of the -w folder. For that, try:

certbot certonly --webroot -w /var/www/html -d [domain.com]

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for carglasspart.com

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/carglasspart.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/carglasspart.com/privkey.pem
This certificate expires on 2023-03-29.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

If you like Certbot, please consider supporting our work by:

i got this by this command

1 Like

Terrific. Since you used certonly you got the cert. Now you need to configure your Apache to use it. The Mozilla SSL Configurator is often helpful (link here)

That proves you can get a cert but I don't think that is best way forward. I think you should create a VirtualHost for port 80 and use the --apache plug-in. Do not use certonly. When --apache works it will configure a VirtualHost for port 443 (https) for you.

Refer to the Ubuntu link I provided earlier on how to do that


Your connection is not private

Attackers might be trying to steal your information from www.carglasspart.com (for example, passwords, messages or credit cards). Learn more


VirtualHost configuration:
*:443 is a NameVirtualHost
default server carglasspart (/etc/apache2/sites-enabled/carglasspart.conf:2)
port 443 namevhost carglasspart (/etc/apache2/sites-enabled/carglasspart.conf:2)
alias www.carglasspart.com
port 443 namevhost www.carglasspart.com (/etc/apache2/sites-enabled/www.carglasspart.conf:2)
alias www.carglasspart.com

i ran the command 1. sudo certbot renew --dry-run
it was successfully done but still my site is showing the error i have pasted above.

You have overlapping virtualhosts. The configuration file carglasspart.conf as well as www.carglasspart.conf have a virtual host for www.carglasspart.com. You should combine the contents of both into a single working configuration file.


And when you combine them into one virtual host you should also get a cert with both names in it


There is no ".com" there,
So, it doesn't cover the base domain name.


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