https:// directadmin force_hostname

Alexander1974

Verified User
Joined
Mar 28, 2017
Messages
22
Location
Rotterdam
Hello,

Twice I tried the manual to add SSL to directadmin 2222
https://help.directadmin.com/item.php?id=629

Where I tried to add server.aalex.org as that is Server's Hostname
Everywhere below where your.hostname.com was, I replaced with server.aalex.org

When i go to https://server.aalex.org then Chrome mentions: not safe (Niet veilig in Dutch).
What am I doing wrong?

I now changed forced_hostname to aalex.org and https;// is now safe but is that good for the server / Directadmin configuration?

cd /usr/local/directadmin/scripts
./letsencrypt.sh request your.hostname.com 4096

which will also install the new cert/key/ca files in all respective global places for apache, dovecot, exim, ftp, and DirectAdmin.
NOTE The hostname value, eg: your.hostname.com must match the "servername" value set in the directadmin.conf, or it will not be in hostname mode, but User domain mode instead.

You must then turn on SSL in DA and tell DA to use the carootcert, as well as force the hostname for SSL:
cd /usr/local/directadmin/conf
perl -pi -e 's/SSL=0/SSL=1/' directadmin.conf
echo "carootcert=/usr/local/directadmin/conf/carootcert.pem" >> directadmin.conf
echo "force_hostname=your.hostname.com" >> directadmin.conf
echo "ssl_redirect_host=your.hostname.com" >> directadmin.conf
service directadmin restart

Thank!
 
fact

Your certificate is ussued to aalex.org not server.aalex.org
go to your site, (if in chrome) press f12 to get the dev tools up, go to the security tab

Certificate error
There are issues with the site's certificate chain (net::ERR_CERT_COMMON_NAME_INVALID).

[View certificate] <-- click this botton
 
Back
Top