I can't seem to get past this error. I can't find anything I did wrong. The site works in http in a browser but certbot can't seem to find it. I have done many certs already so the ports are not blocked.
It produced this output:
certbot certonly --apache --dry-run --agree-tos -m liberty@lc.org -d dashboard.covenantjourney.org
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for dashboard.covenantjourney.org
Waiting for verification...
Challenge failed for domain dashboard.covenantjourney.org
http-01 challenge for dashboard.covenantjourney.org
Cleaning up challenges
Some challenges have failed.
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
My web server is (include version):
Apache/2.4.41 (Ubuntu)
The operating system my web server runs on is (include version):
Ubuntu 20.04.2
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): 0.40.0
Here is my apache config:
<VirtualHost *:80>
ServerName dashboard.covenantjourney.org
DocumentRoot /var/www/html/webroot
LogLevel info
ErrorLog ${APACHE_LOG_DIR}/lc-error.log
CustomLog ${APACHE_LOG_DIR}/lc-access.log combined
I'm not initially seeing anything too troubling. There is a 302 (temporary) redirect from http to https where there should be a 301 (permanent) redirect.
dry-run command yielded the same results as before:
sudo certbot certonly --webroot -w /var/www/html/webroot -d "dashboard.covenantjourney.org" --dry-run
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for dashboard.covenantjourney.org
Using the webroot path /var/www/html/webroot for all unmatched domains.
Waiting for verification...
Challenge failed for domain dashboard.covenantjourney.org
http-01 challenge for dashboard.covenantjourney.org
Cleaning up challenges
Some challenges have failed.
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
Yet it is quite clear from testing that there is a 302 http to https redirect in place. Since dashboard.covenantjourney.org does not have a port 443 (https) VirtualHost, the default port 443 (https) VirtualHost (for cidisrael.org) responds, thus explaining why the challenge file can't be found (because it's being written to the DocumentRoot for cidisrael.org instead of dashboard.covenantjourney.org). Simply commenting-out or removing the 302 redirect for dashboard.covenantjourney.org should fix it. I think said redirect might be in an .htaccess file though rather than the port 80 (http) VirtualHost for dashboard.covenantjourney.org.
Thanks.
What you say makes sense but I cannot find a redirect.
There is no .htaccess in /var/www/html
There is one in /var/www/html/webroot but no mention of dashboard
There are no redirects in /etc/apache2/available-sites
Could there be other locations?
From my screenshots, the cert for cidisrael.org is currently being served when visiting challenge files for dashboard.covenantjourney.org, indicating that the port 443 vHost for cidisrael.org is responding for https requests for dashboard.covenantjourney.org.