Setup Domain For Bitnami WordPress on Google Cloud using Cloudflare

by Fred Osei
269 views

This tutorial will guide you on how to set-up or point your domain name to your WordPress Click to Deploy instance using Cloudflare, Kindly note that you’ll be required to create a Cloudflare account if you don’t have one by default. Read more About Cloudflare Here.


Before we kick off with this tutorial;

  • Make sure you are running the Bitnami Version of WordPress on Google Cloud.

  • Make sure you already have a domain name purchased, if not you should get one from Namecheap (recommended) for just $8.88/yr and benefits from their many features at no cost including a lifetime of WHOIS domain protection.


Let get on with it…

1. Launch your internet browser, navigate to cloudflare.com and then click on the Sign-Up button as in the screenshot below.

2. Enter your email address, choose a password and click on the Create Account button below to continue.

3. Enter your website’s root domain (e.g. if your website domain is www.blogforafrica.com, type blogforafrica.com) as in the screenshot below and click on the Add Site button to continue.

4. Click to select the Free plan in example 1 below and click on the Confirm Plan button as in example 2 below to continue.

5. Wait as Cloudflare attempts to automatically identify your default DNS records as in the screenshot below. This shouldn’t take longer than necessary.

6. Review the imported DNS records, do not make any changes or adjustments, we’ll get there. Scroll down and click on the Continue button as shown below.

Pointing your domain name to Cloudflare’s. (for the purpose of this tutorial we’ll be using Namecheap as the domain name registrar).

7. Navigate to your domain name registrar (in our case, namecheap.com), enter your username or email and password as in the screenshot below and click Sign In button to continue.

8. Click on Domain List from the Left sidebar as in the screenshot below.

9. Click on the Manage button next to the domain name whose nameservers you want to replace with that of Cloudflare as in the screenshot below.

10. Scroll down and find the Nameservers section, click the drop-down arrow as in example 1 below and select “Custom DNS” from the drop-down menu as in example 2 below.

11. Switch to the tab where your Cloudflare is opened, then copy Nameserver 1 and Nameserver 2 as in the screenshot below.

12. Switch back to your domain name cPanel, delete the old nameservers and paste the new nameservers you have just copied from step 11 above into their respective fields and then click on the checkmark icon as in the screenshot below to save the updated changes.

13. Switch back to the Cloudflare tab, scroll down and then click on the button “Done Check Nameservers” as shown below.
14. From Cloudflare when presented with the Security and Speed configuration screen, choose Full (Strict) from the right sidebar as shown in the picture below and then scroll down and click on the Done button to continue.

Take note that nameservers updates do not propagate instantly. AFter nameservers are updated, it may take up to 24 hours (more, in rare cases) for local ISPs to update their DNS caches to make your website available to everyone or for whatever changes you made to take effect.

You can however check your website your domain name using any Proxy server as Proxy servers do not store cache.
15. Scroll down and click on the re-check now button as in screenshot 1 below or on the Cloudflare logo as in screenshot 2 below. (this will direct you to the main Cloudflare dashboard). Your dashboard should show your domain name with a checkmark with an Active status as in screenshot 3 below.

Screenshot 1

Screenshot 2

Screenshot 3

 

Updating WordPress URL

16. Enter or Copy & Paste the command below into your SSH terminal as shown in the screenshot below to open your wp-config.php file.

sudo nano /opt/bitnami/apps/wordpress/htdocs/wp-config.php

17. Use the down arrow key on your keyboard to scroll down until you see the same as highlighted in red in the screenshot below. 

Replace

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/'); 

with

define('WP_SITEURL','http://yourwebsite.com/');
define('WP_HOME','http://yourwebsite.com/');

NB: Please remember to replace “yourwebsite.com” with your actual domain name, and please change the leading http:// to https:// if you have already installed and configured SSL.

18. Save the changes you just made by pressing down ctrl + x on your using your keyboard, hit the Y key to confirm saving and then hit the Enter key save your changes.

19. Restart apache to see your changes by executing the below command.

sudo /opt/bitnami/ctlscript.sh restart apache

 

That’s it.

I hope you found this post useful and that you have been able to Map your Domain Using Cloudflare for WordPress Certified by Bitnami on Google Cloud.

Drop any questions you may have in the comments section below and I will respond as soon as I can. Remember to like share and subscribe to our Social Media channels (links sidebar and footer). @KwikHacks

Leave a Comment