Free SSL Certificate Setup for WordPress on Google Cloud (Click-to-Deploy)

Share:

In this quick-start tutorial by sayhype will teach how to configure free SSL Certification on  WordPress Website, auto-renewing SSL certificates for WordPress websites that are hosted on Google Cloud compute engine. In this tutorial using the (Click-to-Deploy) version method of WordPress on Google Cloud.
If you prefer the Hindi language then I am sure that the following video will better for Click Deploy.


Before getting you started with this tutorial, you should have already with:
1.     Installing WordPress on Google Cloud
2.     Step-by- Step Set up a Domain Name for your WordPress website
3.       Reserved a Static IP Address for your VM instance. (it’s Important and to do carefully).
So let’s get started…
The following steps, instructions will help you through the SSL installation process on Google App Engine. If you thinking that it’s code to deploy, may be hard but this is wrong because this is very essay and safe method to get SSL Certification to generated and completed the validation process.
1. Connecting to WordPress via SSH
Steps go to your Compute Engine.

 Ã  then go to VM instances to access your WordPress installation.
   Click to
à SSH button to connect to your website’s server.


2. Installing CertBot Client

Now it’ time to connect to your website’s Apache server, you are going here to execute the command to install the Certbot client. So,  Certbot client is mainly used to issue the SSL certificates that will be used later on in this tutorial. Use the following code.


wget https://dl.eff.org/certbot-auto && chmod a+x certbot-auto

After hitting Enter Button on Keyboard  of these commands, you can either stay in the same SSH window or exit and open a new one tab.


























3. Step to Generate Certificates
In this step we are going to give command below in order to tell the Certbot client to create SSL certificates for your website. Remember to replace tellmeaboutthis.com with your own domain name.

./certbot-auto certonly --webroot -w /var/www/html/ -d tellmeaboutthis.com -d www.tellmeaboutthis.com

During runing this comment follow instraction 


Select the appropriate number [1-2] then [enter] (press 'c' to cancel)

Press Enter buton 








4. Configure the Certificates Steps


The next step is to configure your certificates. First, execute the command below to open your default-ssl.conf file for editing.


sudo nano /etc/apache2/sites-available/default-ssl.conf

At the top of the default-ssl.conf file, paste the following lines of code in order to tell your server to direct network traffic to HTTPS port 443.

<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

Now next step is to use the down-arrow key to scroll down towards the bottom of the default-ssl.conf file. Please place a # sign as similar line in image then next to the existing snakeoil certificates, and paste the path to your three line SSL certificate files as shown in the command below, making sure to replace  tellmeaboutthis.com with your own domain name.


SSLCertificateFile "/etc/letsencrypt/live/1pagezen.com/cert.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/1pagezen.com/privkey.pem"
SSLCertificateChainFile "/etc/letsencrypt/live/1pagezen.com/chain.pem"

After adding this code, enter ctrl+o to save changes Enter Button & followed by ctrl+x to exit back to your home screen.

5. Enable HTTPS Redirect
The next thing you will do is configure your Apache server to only serve the HTTPS version of your website. To do this, you will edit your wordpress.conf file, which you can access by executing the command below.
sudo nano /etc/apache2/sites-available/wordpress.conf

 After this command new section opened, from there need to delete

Inside of this WordPress.conf file, we are going to delete the existing 3 lines of code at the top of the file. Then, copy and paste the the code below into the file, this is very important steps & remembering to replace tellmeaboutthis.com into your own domain name
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

ServerName www.tellmeaboutthis.com
ServerAlias tellmeaboutthis.com
Redirect permanent / https://www.tellmeabouthis.com/

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
After adding the code to your wordpress.conf file, enter ctrl+o to save your changes and ctrl+x to exit the wordpress.conf file.
6. Need to Restart the Apache Server
In order for your certificate changes to take effect, you need to update/restart you Apache server by executing all three of the commands listed below.
1. sudo a2ensite default-ssl
2. sudo a2enmod ssl
3. sudo service apache2 restart


7. Steps to Update WordPress URLs


In your browser, enter the URL (with https://) to your wp-admin dashboard.



From your WordPress Admin dashboard after admin login, navigate to Settings > General, and replace your current domain name with the http:// to https:// version -with or without www. infront. then, scroll to the bottom of the page and you need to click the Save Changes button.

8. Configure SSL Auto-Renewal

Do you want your SSL certificates to renew free automatically? In the following steps we will learn how to configure auto-renewal for your SSL certificates step by step  - so let's get started to do!
The first step in configuring code toauto-renewal is to use the mv command

to move your certbot package into the letsencrypt directory. So copy this and paste there…
sudo mv certbot-auto /etc/letsencrypt/
You can verify similar as image that your certbot-auto package has been moved successfully by executing the command ls /etc/letsencrypt/ and seeing if the certbot-auto package appears in that directory.

Now that you've opened your crontab file to edit, the next step is to add a script at the bottom of the crontab file which will executing once per week and will automatically renew free  SSL certificates if they are about to expire.
Code: 45 2 * * 6 cd /etc/letsencrypt/ && ./certbot-auto renew && /etc/init.d/apache2 restart
At the bottom of your this crontab file, we will enter a script which will tell your apache server to check for certificate renewals once per week automatically and to renew the certificates if they are about to expire face. After adding the script, save the crontab file by pressing CTRL + X, then Y, then Enter.

That's it! 🙂

If you're interested in learning about Such type of topic then, don't take time to subscribe https://goo.gl/TkqnXF 



7 comments:

  1. Thanks for your insight for your fantastic posting. I’m glad I have taken the time to see this. https://hostinglelo.in/

    ReplyDelete
  2. Hosting is a major part of our Internet lives, but don't be misled that it is free when you buy your domain name, because like virtually everything else that we purchase, it is all glossed over with great sales talk. Has it ever occurred to you that the price is added to our domain name, which we can buy a lot cheaper, saving a considerable amount of money over the course of a year? Once you understand what hosting is and where you can purchase it from, you will soon realize, how much money you are throwing down the drain? https://onohosting.com/

    ReplyDelete
  3. Good website! I truly love how it is easy on my eyes it is. I am wondering how I might be notified whenever a new post has been made. I have subscribed to your RSS which may do the trick? Have a great day! https://hostinglelo.in/

    ReplyDelete
  4. It is this need that drives the SaaS vendor to provide a quality service in their application, along with quality customer service when needed. free restream review

    ReplyDelete
  5. SSL Services Provider , sounds like a new Mercedes. It's actually a protocol for managing the secure interactions between a web browser and a web server. Should your site have SSL? Read the following article to find out.

    ReplyDelete