Right, So I have spun up another VM, different name, IP ect, got apache working and I went to the CNAME I set which is music.sopel.dev, I go to the padlock, inspect the certificate (I have NOT run certbot yet) and it says common name is nextcloud.sopel.dev, why?
I nuked the other server, I am getting error now though. Please see below:
s0ap@music:~$ sudo certbot
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: music.sopel.dev
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Requesting a certificate for music.sopel.dev
Performing the following challenges:
http-01 challenge for music.sopel.dev
Enabled Apache rewrite module
Waiting for verification...
Challenge failed for domain music.sopel.dev
http-01 challenge for music.sopel.dev
Cleaning up challenges
Some challenges have failed.
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: music.sopel.dev
Type: connection
Detail: 185.222.21.139: Fetching
http://music.sopel.dev/.well-known/acme-challenge/Kc3qntfbdPzMwN4gb757n22y48iPrnvdjZMMQIy0qUY:
Error getting validation data
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. Additionally, please check that
your computer has a publicly routable IP address and that no
firewalls are preventing the server from communicating with the
client. If you're using the webroot plugin, you should also verify
that you are serving files from the webroot path you provided.
And your output is:
s0ap@music:~$ sudo ss -tlpn
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=966,fd=14))
LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=1611,fd=3))
LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=1611,fd=4))
LISTEN 0 511 *:80 *:* users:(("apache2",pid=4416,fd=4),("apache2",pid=4415,fd=4),("apache2",pid=3039,fd=4))
Like I said in my initial post, I made a mistake and I added nextcloud.sopel.dev and sopel.dev as A records, pointing to the same IP address. When I can certbot for my nextcloud server it worked just fine, everything after that stopped working (apart from nextcloud) once I removed nextcloud.sopel.dev as an A record and made it a CNAME record. Are certbot servers still using the old A record that I deleted?
I am using ESXi, each server is a separate VM. Each VM has only one service running. That's what I am suspecting, every instance I run from any server somehow references nextcloud.sopel.dev even though it's already gone. I think I nuked my own domain
Hi, just to let you know, I followed your advice but instead of caddy I set up a dedicated nginx server as a reverse proxy and for SSL. Everything is working now. Thank you a lot.