Hi! I’ve been struggling getting a certificate for my website. I run sudo certbot --apache, and it returns invalid response. From what I understand, my website doesnt find the challenges sent by certbot, so it returns a 404. I made a test adding a directory in apache, and it could retrieve the files in there. Also, when I check apache’s access logs, it sometimes shows certbot request, but most of the time it doesnt, while the output it shows is from my website.
My domain is: datlas.io
I ran this command: sudo certbot --apache
It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: datlas.io
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for datlas.io
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. datlas.io (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://datlas.io/.well-known/acme-challenge/IZcYUED5ryRJvfk5o0CIv51IOBXLfqGsxx4NABa0yus [184.168.131.241]: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n\n<head>\n <title>Datlas</ti"
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: datlas.io
Type: unauthorized
Detail: Invalid response from
http://datlas.io/.well-known/acme-challenge/IZcYUED5ryRJvfk5o0CIv51IOBXLfqGsxx4NABa0yus
[184.168.131.241]: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML
4.01//EN\"\n
\"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n\n<head>\n
<title>Datlas</ti"
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.29
The operating system my web server runs on is (include version): Ubuntu 18.04.2 LTS
My hosting provider, if applicable, is: GoDaddy
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 0.31.0
Here’s my apache config, in case you need it:
<VirtualHost *:80>
ServerName datlas.io
ServerAdmin tecnologias@datlas.mx
DocumentRoot /home/ubuntu/backend
<Directory /home/ubuntu/backend>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /home/ubuntu/backend/static
<Directory /home/ubuntu/backend/static>
Require all granted
</Directory>
<Directory /home/ubuntu/backend/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess myproject python-path=/home/ubuntu/backend:/home/ubuntu/backend/venv/lib/python3.6/site-packages
WSGIProcessGroup myproject
WSGIScriptAlias / /home/ubuntu/backend/mysite/wsgi.py
SetEnv DJANGO_SETTINGS_MODULE ${DJANGO_SETTINGS_MODULE}
SetEnv SECRET_KEY ${SECRET_KEY}
SetEnv Debug ${Debug}
SetEnv Name ${Name}
SetEnv RDS_DB_NAME ${RDS_DB_NAME}
SetEnv RDS_HOSTNAME ${RDS_HOSTNAME}
SetEnv RDS_PASSWORD ${RDS_PASSWORD}
SetEnv RDS_PORT ${RDS_PORT}
SetEnv RDS_USERNAME ${RDS_USERNAME}
</VirtualHost>
Lastly, here’s what i added to test if apache could retrieve files, which worked:
Alias “/.well-known” “/.well-known”
<Directory /.well-known>
Require all granted