I am trying to migrate from Ubuntu 18 -> 20, as well as django old -> current, and python2 -> 3. It seems that my new server's configuration is broken somehow and I haven't been able to get certbot to succeed despite several hours of trial & error, google/stackoverflow, and searching this forum. I would really appreciate some help!
I'm trying to include all the information I've seen requested in other posts below; obviously I'm happy to provide more if I'm leaving something out.
It seems a lot like django is gobbling up requests that I don't want it to, and causing my HTTP-01 challenge to fail at http://bailinphil.com/.well-known/acme-challenge/MbpIAWbRlQ7EbaqZxl5E5jaGTJ_Kqzvl9n_DqcBUhI8 . But this is just my working theory.
My domain is:
I ran this command:
sudo certbot --apache
It produced this output:
...
- The following errors were reported by the server:
Domain: bailinphil.com
Type: unauthorized
Detail: Invalid response from
http://bailinphil.com/.well-known/acme-challenge/MbpIAWbRlQ7EbaqZxl5E5jaGTJ_Kqzvl9n_DqcBUhI8
[161.35.100.35]: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n
<meta http-equiv=\"content-type\" content=\"text/html;
charset=utf-8\">\n <title>Page not "
Domain: electricowlstudios.com
Type: unauthorized
Detail: Invalid response from
http://electricowlstudios.com/.well-known/acme-challenge/Y86m-LoA9x1ZmCEUEQuHWVrwV05zrQZLUdmsIn9eaXk
[161.35.100.35]: "<!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.bailinphil.com
Type: unauthorized
Detail: Invalid response from
http://www.bailinphil.com/.well-known/acme-challenge/hg8DZnJJEpLGDajhnuk9XSRkkuePohYUzsIexrrAOcg
[161.35.100.35]: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n
<meta http-equiv=\"content-type\" content=\"text/html;
charset=utf-8\">\n <title>Page not "
Domain: www.electricowlstudios.com
Type: unauthorized
Detail: Invalid response from
http://www.electricowlstudios.com/.well-known/acme-challenge/ntrSyE6CR3Rd5gfulYKGss48Rm1YjxkWC4EMzdCE1nA
[161.35.100.35]: "<!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 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 LTS
My hosting provider is:
Digital Ocean
I can login to a root shell on my machine
yes
I'm using a control panel to manage my site
no
The version of my client is
certbot 1.12.0
apachectl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80 is a NameVirtualHost
default server bailinphil.com (/etc/apache2/sites-enabled/bailinsite.conf:2)
port 80 namevhost bailinphil.com (/etc/apache2/sites-enabled/bailinsite.conf:2)
alias www.bailinphil.com
port 80 namevhost electricowlstudios.com (/etc/apache2/sites-enabled/electricowl.conf:1)
alias www.electricowlstudios.com
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used
Apache configuration
<VirtualHost *:80>
ServerName bailinphil.com
ServerAlias www.bailinphil.com
ServerAdmin webmaster@localhost
Alias /robots.txt /mnt/backlog_photos_db/var/website/robots.txt
Alias /favicon.ico /mnt/backlog_photos_db/var/website/static/images/favicon.ico
Alias /images/ /mnt/backlog_photos_db/var/website/static/images/
Alias /about/ /mnt/backlog_photos_db/var/website/static/about/
Alias /css/ /mnt/backlog_photos_db/var/website/static/css/
Alias /static/ /mnt/backlog_photos_db/var/website/static/
<Directory /mnt/backlog_photos_db/var/website/static>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
WSGIDaemonProcess mainPyProc python-path=.:/mnt/backlog_photos_db/var/website/bailinsite/backlog/
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias / /mnt/backlog_photos_db/var/website/bailinsite/bailinsite/wsgi.py process-group=mainPyProc
ErrorLog ${APACHE_LOG_DIR}/bailinsite-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine off
RewriteCond %{SERVER_NAME} =bailinphil.com [OR]
RewriteCond %{SERVER_NAME} =www.bailinphil.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
Additional debugging
I see on https://check-your-website.server-daten.de/?q=bailinphil.com that I should add an AAAA record for IPv6. I'm working on that now, but don't see anything else in the results which seem useful.
Thank you!