Securing the traffic to and from your site is essential in any modern website or web application.
An SSL certificate adds this security and Let’s Encrypt can issue a certificate for your site.
Install The Lego Client
We’re going to use the Lego Client to help us with the generation of the certificate.
Download the Lego Client
If you do not have the Lego Client installed on your instance, grab this first:
Check if you have it:: $~ lego -v
Install Lego:
$~ cd /tmp
$~ curl -Ls https://api.github.com/repos/xenolf/lego/releases/latest | grep browser_download_url | grep linux_amd64 | cut -d ‘”‘ -f 4 | wget -i –
$~ tar xf lego_vX.Y.Z_linux_amd64.tar.gz – Replace the “X.Y.Z” placeholder with the version that was downloaded
$~ sudo mkdir -p /opt/bitnami/letsencrypt
$~ sudo mv lego /opt/bitnami/letsencrypt/lego
Turn off Bitnami Services
Generate the Certificate
Configure the Web Server to use the Let's Encrypt Certificate
$~ sudo mv /opt/bitnami/apache2/conf/server.crt /opt/bitnami/apache2/conf/server.crt.old
$~ sudo mv /opt/bitnami/apache2/conf/server.key /opt/bitnami/apache2/conf/server.key.old
$~ sudo mv /opt/bitnami/apache2/conf/server.csr /opt/bitnami/apache2/conf/server.csr.old
$~ sudo mv /opt/bitnami/apache2/conf/server.crt /opt/bitnami/apache2/conf/server.crt.old
$~ sudo ln -sf /opt/bitnami/letsencrypt/certificates/DOMAIN_ONE.key /opt/bitnami/apache2/conf/server.key
$~ sudo ln -sf /opt/bitnami/letsencrypt/certificates/DOMAIN_TWO.key /opt/bitnami/apache2/conf/server.key
$~ sudo ln -sf /opt/bitnami/letsencrypt/certificates/DOMAIN_ONE.crt /opt/bitnami/apache2/conf/server.crt
$~ sudo ln -sf /opt/bitnami/letsencrypt/certificates/DOMAIN_TWO.crt /opt/bitnami/apache2/conf/server.crt
$~ sudo chown root:root /opt/bitnami/apache2/conf/server*
$~ sudo chmod 600 /opt/bitnami/apache2/conf/server*
Re-Start Bitnami Services
$~ sudo /opt/bitnami/ctlscript.sh start