Configuring Certbot to work on Bitnami Apache

I’m not entirely familiar with Bitnami, just downloaded the VM to explore a bit as a few people have reported having trouble with it, but I haven’t used it on an actual website myself.

Using the webroot plugin would look something like this:

certbot certonly --webroot -w /opt/bitnami/apache2/htdocs -d example.com -d www.example.com --post-hook="/opt/bitnami/ctlscript.sh restart apache"

Replace example.com with your real domain name; remove -d www.example.com if you don’t use the www subdomain. You might have to change the paths if Bitnami is installed in a different location or you’re using a different web root.

If that works, edit the Apache configuration in /opt/bitnami/apache2/conf. Find these two lines:

SSLCertificateFile "/opt/bitnami/apache2/conf/server.crt"
SSLCertificateKeyFile "/opt/bitnami/apache2.conf/server.key"

and replace them with the following:

SSLCertificateFile "/etc/letsencrypt/live/example.com/fullchain.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/example.com/privkey.pem"

replacing example.com with your certificate name. If you don’t remember your certificate name, you can find it by typing certbot certificates.

Next, restart Apache by typing:

/opt/bitnami/ctlscript.sh restart apache.

At this point, hopefully (if I haven’t forgotten anything), the HTTPS version of your website should be up and running.

1 Like