Question

Let's Encrypt: invalid response from /.well-known/acme-challenge/ when running certbot --apache (Apache, Ubuntu 20.04)

I have a number of sites on a new Ubuntu 20.04 server, using the WP image, using Apache virtual hosts.

When setting up this particular website, by running certbot --apache and selecting the domain and www version, I get this error:

Domain: website.com Type: unauthorized Detail: Invalid response from https://website.com/.well-known/acme-challenge/KfHqC9jlLM4kDrCkXEVCbWptpRw5sM8IEW1KrkHHdec [2606:4700:3031::ac43:9a53]: “<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p”

Domain: www.website.com Type: unauthorized Detail: Invalid response from https://www.website.com/.well-known/acme-challenge/Tu_rA1qZqphdzQ46_Jb6UTHERvuUsme4-G-WQmdVP4c [2606:4700:3035::6815:309f]: “<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p”

My website.com.conf in sites-available looks like:

<VirtualHost *:80> ServerAdmin admin@website.com DocumentRoot /var/www/website.com/public_html ServerName website.com ServerAlias www.website.com

    <Directory /var/www/website.com/public_html>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <IfModule mod_dir.c>
        DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
    </IfModule>

</VirtualHost>

I have recently installed SSL certificates on all of my other sites on this server without an issue. What might be the problem here?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

This usually happens when your domain name is not pointing to your server.

In order for Let’s Encrypt to be able to validate your domain name, you need to have your A record set to point to the server IP address first before running the certbot command.

Here is how to add new DNS records:

https://docs.digitalocean.com/products/networking/dns/how-to/manage-records/

Hope that this helps!

Best,

Bobby