An SSL Certificate is a block of code on a web server that facilitates encryption between a web server and a web host. It prevents your communication from being intercepted or manipulated by eavesdropping third parties.
Nowadays, SSL is essential for any kind website, even if it doesn’t handle sensitive information like your debit or credit cards details. It also helps to improve your SERP position on the search engine. So, having an HTTPS version of your site can be beneficial for your website SEO.
Suggested Reading – How to Install WordPress on Google Cloud Platform (Bitnami Version)
In this tutorial, you will learn how to install and configure a free, auto-renewing SSL certificate for your Bitnami WordPress site that hosted on GCP Compute Engine.
Ok, Now Let’s Get started
Steps to Install and Configure an SSL Certificate for your Bitnami WordPress Site on GCP
I assumed that you already had done WordPress Installation on GCP ( Bitnami Version ) and also completed Domain Set up and configuration for your site. Ok, now follow my steps below to Install and Setup Let’s Encrypt free SSL Certificate for your WordPress Site.
Connect to WordPress via SSH
Step 1: Log in to your Google Cloud Console dashboard and then go to VM Instances.
Step 2: At the VM Instances page, you will see the SSH option. Now simply click on the SSH button to connect with your WordPress installation.
Generate SSL Certificate for your site
Step 3: Now after connected to VM Instances via SSH, you need to enter the following comment and then press enter to generate your website SSL Certificate.
sudo /opt/bitnami/letsencrypt/scripts/generate-certificate.sh -m example@gmail.com -d bloggerlessons.com -d www.bloggerlessons.com
Please note – You need to replace “example@gmail.com” with your email address and instead of “bloggerlessons.com” use your domain. Before entering the comment, don’t forget to modify these parts.
Configure SSL Certificate
Step 4: Now, after entering the certificate issuing command, you will be prompted with three different questions, and for each of those questions, press “Y” and then press the Enter button.
Configure HTTPS Redirect
Step 5: After the SSL certificate configuration, the next step is to configure a redirect in our bitnami.conf file to redirect all traffic to the HTTPS (Secured) version of your site. To do this, copy and paste the command below to open the bitnami.conf file for editing.
sudo nano /opt/bitnami/apache2/conf/bitnami/bitnami.conf
Step 6: Ok, now you’ve opened the bitnami.conf file for editing. Now just copy and paste the three lines of code below, in the same location as shown in the following screenshot (remember to replace bloggerlessons.com with your own domain name). After editing the file, press CTRL+X then Y to save and exit the file.
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://www.bloggerlessons.com/$1 [R,L]
Restart Apache Server
Step 7: After making changes to the file, you will need to restart your server for changes to take effect. To do this, copy and paste the following command into your terminal and then press Enter.
sudo /opt/bitnami/ctlscript.sh restart apache
That’s It
Now you just finished the configuration of Let’s encrypt free auto-renewing SSL certificate for your website. If you run into any issues with your SSL Certificates and want to verify that they’re appropriately configured or not then, this SSL Checker tool can help you.
You might also like – How to Setup Free SSL for WordPress on Google Cloud (Click-to-Deploy Version)
I hope this tutorial helps you to solve your problem. If you face any trouble, then please let me know by commenting below.
Thankyou Bro it works for me keep continue this type of blogs:)
Thanks for your feedback.
I am getting this error
http://www.clipular.com/posts/5514102599057408?k=KBy_1qmD0n2sF84GzfEaCJh94CA
Thanks for Contacting me! Just Fixed your SSL Problem. Hope you are happy now 🙂 Don’t forget to share my blog with your friends and family.