Ch3vr0n
Verified User
- Joined
- Aug 24, 2014
- Messages
- 88
For the purpose of this post i will change terminal actual value of hostnames to oldname.tld and newname.tld
Now to the problem at hand.
I'm running a small VPS that had the hostname set to s1.oldname.tld and in directadmin domein setup showed da.s1.oldname.tld. I went into administrator settings and changed it from s1.oldname.tld to s1.newname.tld and DA restarted. So far so good. Except now i'm getting a SSL certificate error (hostname mismatch). I figured, lets check at userlevel. sure enough it mentioned oldname.tld, so removed the domain there and added the new da.s1.newname.tld. Fixed i though. Nope, still browser certificate warning. So i tried to set it serverwide by SSH but there's a problem.
So i figured lets try the let's encrypt script
Yes, that's not a mistake. the terminal output uses the OLD hostname which according to documentation should have been updated with the new one once i edited the hostname in DA administrator settings. directadmin.conf IS updated with the proper hostname yet its still not working.
I'm a total linux noob and this is an unmanaged VPS, so i need to do this myself (hoster that initially set it up merged with a larger company a couple years ago, and they just started merging with another larger one a few months ago. These ones only offer MANAGED vps's but keep the existing unmanaged vps customers, like myself).
checked directadmin.conf and found another value at
servername=s1.oldname.tld so changed that to s1.newname.tld
ssl_redirect_host=s1.oldname.tld so changed that one to s1.newname.tld
Hoped that would fix it so reran the ssl request script. Nope, still used oldname.tld
Because of being a total noob i need STEP BY STEP and exact instructions on where to fix things and how. Your expert knowledge and advice will be highly appreciated.
Now to the problem at hand.
I'm running a small VPS that had the hostname set to s1.oldname.tld and in directadmin domein setup showed da.s1.oldname.tld. I went into administrator settings and changed it from s1.oldname.tld to s1.newname.tld and DA restarted. So far so good. Except now i'm getting a SSL certificate error (hostname mismatch). I figured, lets check at userlevel. sure enough it mentioned oldname.tld, so removed the domain there and added the new da.s1.newname.tld. Fixed i though. Nope, still browser certificate warning. So i tried to set it serverwide by SSH but there's a problem.
[root@s1 scripts]# /usr/local/directadmin/directadmin set hostname s1.newname.tld
Error with the current values:
Cannot find 'hostname' in the directadmin.conf
[root@s1 directadmin]# ./directadmin set name s1.newname.tld
name=s1.newname.tld
So i figured lets try the let's encrypt script
[root@s1 scripts]# ./letsencrypt.sh request s1.newname.tld 4096
Setting up certificate for a hostname: s1.newname.tld
2021/11/18 17:28:28 [INFO] [ftp.s1.oldname.tld, mail.s1.oldname.tld, pop.s1.oldname.tld, s1.oldname.tld, smtp.s1.oldname.tld, www.s1.oldname.tld] acme: Obtaining SAN certificate
2021/11/18 17:28:30 [INFO] [ftp.s1.oldname.tld] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/49735031630
2021/11/18 17:28:30 [INFO] [mail.s1.oldname.tld] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/49735031640
2021/11/18 17:28:30 [INFO] [pop.s1.oldname.tld] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/49735031650
2021/11/18 17:28:30 [INFO] [s1.oldname.tld] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/49735031660
2021/11/18 17:28:30 [INFO] [smtp.s1.oldname.tld] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/49735031670
2021/11/18 17:28:30 [INFO] [www.s1.oldname.tld] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/49735031680
2021/11/18 17:28:30 [INFO] [ftp.s1.oldname.tld] acme: authorization already valid; skipping challenge
2021/11/18 17:28:30 [INFO] [smtp.s1.oldname.tld] acme: authorization already valid; skipping challenge
2021/11/18 17:28:30 [INFO] [mail.s1.oldname.tld] acme: authorization already valid; skipping challenge
2021/11/18 17:28:30 [INFO] [pop.s1.oldname.tld] acme: authorization already valid; skipping challenge
2021/11/18 17:28:30 [INFO] [s1.oldname.tld] acme: authorization already valid; skipping challenge
2021/11/18 17:28:30 [INFO] [www.s1.oldname.tld] acme: authorization already valid; skipping challenge
2021/11/18 17:28:30 [INFO] [ftp.s1.oldname.tld, mail.s1.oldname.tld, pop.s1.oldname.tld, s1.oldname.tld, smtp.s1.oldname.tld, www.s1.oldname.tld] acme: Validations succeeded; requesting certificates
2021/11/18 17:28:35 [INFO] [ftp.s1.oldname.tld] Server responded with a certificate.
Certificate for ftp.s1.oldname.tld,mail.s1.oldname.tld,pop.s1.oldname.tld,s1.oldname.tld,smtp.s1.oldname.tld,www.s1.oldname.tld has been created successfully!
DirectAdmin certificate has been setup.
Setting up cert for Exim...
Setting up cert for WWW server...
Setting up cert for FTP server...
The services will be restarted in about 1 minute via the dataskq.
Yes, that's not a mistake. the terminal output uses the OLD hostname which according to documentation should have been updated with the new one once i edited the hostname in DA administrator settings. directadmin.conf IS updated with the proper hostname yet its still not working.
I'm a total linux noob and this is an unmanaged VPS, so i need to do this myself (hoster that initially set it up merged with a larger company a couple years ago, and they just started merging with another larger one a few months ago. These ones only offer MANAGED vps's but keep the existing unmanaged vps customers, like myself).
checked directadmin.conf and found another value at
servername=s1.oldname.tld so changed that to s1.newname.tld
ssl_redirect_host=s1.oldname.tld so changed that one to s1.newname.tld
Hoped that would fix it so reran the ssl request script. Nope, still used oldname.tld
Because of being a total noob i need STEP BY STEP and exact instructions on where to fix things and how. Your expert knowledge and advice will be highly appreciated.
Last edited: