Normally, to restore SSL certificate for the user domain I will do the normal DA backup from GUI and restore the user profile and this will also restore SSL certificate. But let say that I only have the certificate file that I got from .lego backup (this was recommended from letsencrypt to do backup on this folder after successfully requesting SSL certificate) but I found no tutorial or documentation on how do we restore this certificate for the user domain using files from this .lego folder (/usr/local/directadmin/data/.lego).
At this point (to help others) I know how to restore the hostname (or server-wide) SSL certificate from this .lego folder and there is a nice script from Poralix (@zEitEr) that is also able to automate this process: https://github.com/poralix/directadmin-utils/blob/master/ssl/install_server_wide_cert.sh
For example in /usr/local/directadmin/data/.lego/certificates let say the hostname is myserver.domain.com so normally it contains these 3 specific files:
So, if you want to restore the certificate for myserver.domain.com certificate without having to request SSL cert again you will execute this
This is working fine for hostname but is there a documented step that is able to restore this certificate for user domains from .lego folder? I think this should be documented somewhere.
At this point (to help others) I know how to restore the hostname (or server-wide) SSL certificate from this .lego folder and there is a nice script from Poralix (@zEitEr) that is also able to automate this process: https://github.com/poralix/directadmin-utils/blob/master/ssl/install_server_wide_cert.sh
For example in /usr/local/directadmin/data/.lego/certificates let say the hostname is myserver.domain.com so normally it contains these 3 specific files:
Code:
myserver.domain.com.crt
myserver.domain.com.issuer.crt
myserver.domain.com.key
So, if you want to restore the certificate for myserver.domain.com certificate without having to request SSL cert again you will execute this
Code:
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/ssl/install_server_wide_cert.sh
chmod +x install_server_wide_cert.sh
# Usage: ./install_server_wide_cert.sh <PATH_TO_CERT> <PATH_TO_KEY> [<PATH_TO_CACERT>]
./install_server_wide_cert.sh myserver.domain.com.crt myserver.domain.com.key myserver.domain.com.issuer.crt
This is working fine for hostname but is there a documented step that is able to restore this certificate for user domains from .lego folder? I think this should be documented somewhere.
Last edited: