Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error while running apache2ctl configtest.
Action 'configtest' failed.
The Apache error log may have more information.
AH00526: Syntax error on line 17 of /etc/apache2/sites-enabled/example1.com-le-ssl.conf:
SSLCertificateFile: file '/etc/letsencrypt/live/example2.net/fullchain.pem' does not exist or is empty
How would you like to authenticate with the ACME CA?
1: Apache Web Server plugin (apache) [Misconfigured]
2: Spin up a temporary webserver (standalone)
3: Place files in webroot directory (webroot)
Select the appropriate number [1-3] then [enter] (press 'c' to cancel):
I get the above and don't know what to do from here.
It was an old mistake I made. I have multiple virtual hosts/websites on the same droplet, and by mistake, I used a cert for one domain name to another, and it worked perfectly. I just didn't know, so I deleted the certificate by mistake,
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/example1.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/example1.com/privkey.pem
This certificate expires on 2023-10-06.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
But for some reason, it is not working, the site is just not encrypted.
You used certonly. Did you, after getting the certificate, manually install the certificate into your Apache configuration? If not, did you understand the meaning of the certonly subcommand? If not, why did you use an option you didn't understand?
There's no good or bad command (at least if it works). It's just that when you use certonly, you'll get, well, as the command implies, only a cert. The rest (i.e., the installing part) is up to the user.
Basically the issue here is that certbot delete doesn't undo everything that certbot --apache does, and certbot certonly doesn't do everything that certbot --apache does.
certbot --apache gets the cert and adds the lines to your configuration file that you saw
certbot delete just deletes the certificate, but doesn't remove the edits to the configuration file
and certbot certonly will get the cert but not install it (in this context, not add the lines referencing it to the Apache configuration file)
So basically none of these things are exact inverses of each other (which can certainly be confusing).
It's a somewhat unmaintained feature so I also never suggest it (but I should probably test it out sometime and see how well it actually works nowadays).