armorcom@localhost:~$ sudo service apache2 restart
armorcom@localhost:~$ apachectl -t -D DUMP_VHOSTS
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:443 armor-computers.com (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
*:80 _ (/etc/apache2/sites-enabled/000-default.conf:1)
<VirtualHost *:80>
ServerName _
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html # THIS ALSO NEEDS TO BE CHANGED [TOO RISKY FOR ME]
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#skip challenge requests and
<LocationMatch "^/(?!\.well-known)">
#send all other requests to HTTPS
RewriteEngine On
RewriteCond %{SERVER_NAME} =armor-computers.com
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1
</LocationMatch>
</VirtualHost>
Anyway, I've added your latest example to 000-default.conf
I didn't change the DocumentRoot directory because I feel since it's only serving static HTML it's pretty safe. Additionally, there's nothing on this machine other than the apache2 server, so all data loss across the entire machine would still be acceptable.
I didn't attempt to generate one because you said "stop doing that" and I didn't realize I was supposed to try there, lol, my bad.
I ran it, it DID get the cert, but failed to install.
I am currently investigating the error, will update with solution if I find one
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/armor-computers.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/armor-computers.com/privkey.pem
This certificate expires on 2022-10-21.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Successfully deployed certificate for armor-computers.com to /etc/apache2/sites-enabled/000-default-le-ssl.conf
Failed redirect for armor-computers.com
Unable to set the redirect enhancement for armor-computers.com.
NEXT STEPS:
- The certificate was saved, but could not be installed (installer: apache). After fixing the error shown below, try installing it again by running:
certbot install --cert-name armor-computers.com
Unable to find corresponding HTTP vhost; Unable to create one as intended addresses conflict; Current configuration does not support automated redirection
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
edit:
maybe this helps
$ sudo apachectl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:443 armor-computers.com (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
*:80 _ (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33