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.
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.
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.
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.
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/'); define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');
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
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