Install LetsEncrypt SSL on Bitnami
NOTE: bitnami provides a tool to install SSL, it is better to use the tool to install SSL. You can see more info on page How to install LetsEncrypt SSL on Bitnami WordPress Server
To install LetsEncrypt SSL on bitnami wordpress server, install letsencrypt with
1 2 |
wget https://raw.githubusercontent.com/serverok/server-setup/master/install/letsencrypt.sh sh ./letsencrypt.sh |
Stop apache web server with
1 |
/opt/bitnami/ctlscript.sh stop apache |
Now get SSL certificate using certbot
1 |
certbot certonly --standalone -d YOUR-DOMAIN.EXT -d www.YOUR-DOMAIN.EXT |
Now you have SSL certficate, lets copy it to bitnami folder
1 2 3 |
cat /etc/letsencrypt/live/YOUR-DOMAIN.EXT/privkey.pem > /opt/bitnami/apache2/conf/server.key cat /etc/letsencrypt/live/YOUR-DOMAIN.EXT/cert.pem > /opt/bitnami/apache2/conf/server.crt cat /etc/letsencrypt/live/YOUR-DOMAIN.EXT/chain.pem >> /opt/bitnami/apache2/conf/server.crt |
Start the web server with
1 |
/opt/bitnami/ctlscript.sh start apache |
Auto Renew LetsEncrypt
Create file
1 2 |
mkdir /usr/serverok vi /usr/serverok/ssl-renew |
Add following to the file. Replace YOUR-DOMAIN.EXT with your actual domain name.
1 2 3 4 5 6 7 8 9 |
#!/bin/bash /opt/bitnami/ctlscript.sh stop apache /usr/bin/certbot renew cat /etc/letsencrypt/live/YOUR-DOMAIN.EXT/privkey.pem > /opt/bitnami/apache2/conf/server.key cat /etc/letsencrypt/live/YOUR-DOMAIN.EXT/cert.pem > /opt/bitnami/apache2/conf/server.crt cat /etc/letsencrypt/live/YOUR-DOMAIN.EXT/chain.pem >> /opt/bitnami/apache2/conf/server.crt sleep 20 /opt/bitnami/ctlscript.sh restart apache |
make the script executable
1 |
chmod 755 /usr/serverok/ssl-renew |
Set a cronjob to execute it every month
1 |
30 2 * * 1 /usr/serverok/ssl-renew >> /var/log/le-renew.log |
See bitnami