Why CloudFlare for Developers?

Welcome for our today’s event loop on {{ PLP}}, prepare your self and notes as we’re getting deeper in our web server configuration and is it important for us to secure our web server and the best practices in our industry today.

Introduction

In this event loop on {{ PLP }}, I’ll be introducing to you the most reliable and one of the best ways in securing our web server from the clutches of bad hands and you know what I mean.

You know, our industry is constantly evolving nowadays, and there are always hacking activities everywhere stealing data from our databases unintended and without you knowing it.

Changing our website’s homepage and many more, of course, there are still many good technologies out there providing us and the world in safeguarding our data over the internet. 

I would love to introduce to you about CloudFlare technology that becomes part of our every project to be developed soon.

What is CloudFlare?

Cloudflare is one of the biggest networks operating on the Internet. People use Cloudflare services for the purposes of increasing the security and performance of their websites and services.

According to their website: https://www.cloudflare.com/learning/what-is-cloudflare/

I’ll guide you step-by-step on securing your website and getting a free SSL provided by CloudFlare

CloudFlare is free and I’m actually using it free as well.  They also have a premium service for large companies or enterprises that suits your need.

Step 1:  Get a Free Account on CloudFlare

Sign up to CloudFlare and do the necessary email activation process as usual and then head over to your CloudFlare dashboard and “Add a Site“.

Inside my CloudFlare dashboard, I added the new site to be secured by CloudFlare itself.  Click that “Add Site” button after entering your domain name without HTTPS, HTTP or WWW.

Click Next button and CloudFlare will look into your DNS records as you can see on the screen.

Select that “FREE” plan and then click “Confirm Plan” button to proceed.

Then click that “Confirm” button for your free plan.

In the screenshot above, as you can see, CloudFlare captured our existing Domain DNS settings from Godaddy, did you remember that in the last event loop prior to this topic, we did purchaseIpaskil.com” from Godaddy domain registrar right?

If you missed that event loop, just a quick check on that event loop in titled: How to Add and Configure Domain Name for Ubuntu 18.04 LTS with NGINX on Linode Cloud Server.

Step 2:  Access your Domain Registrar Site

In my case, my domain registrar is Godaddy, so I access my Godaddy account and I can only screenshot of what I’ve right now.

But, don’t worry as most of the domain registrars are having DNS Management where you can change your Nameservers anytime.

Please take note that some DSN may take time up to 24 hrs to propagate throughout the major web servers around the world.  If just in case you want to check out the status of your DNS, I recommend you can check from DNS Checker Tool and it’s free as well.

And scroll below to look for “Nameservers” option from GoDaddy DNS Management tool.

Why do we need to change our Nameservers?  Usually when you purchased your domain name from any domain registrars out there is that they will automatically set to their default web servers of course and just in case you use their own web hosting then no need for you to modify any default settings from them.

Back to the question, why? Just because, I’m not using the Godaddy’s web server for “Ipaskil.com” domain name to be protected by CloudFlare servers. 

Meaning, all my website traffic passes through CloudFlare’s servers for better web security like the common DDOS attack, better Caching of web pages either static or dynamic, and all those web security issues and I want my traffic to be encrypted by CloudFlare so it won’t be easily intercepted by anonymous users.

Check out How CloudFlare works and we can go straight from the source by itself.

Step 3: Get NameServers from CloudFlare

After you click on the “Continue” button refer to the Step 1 at the last image I screenshot for you.

Copy the NameServers provided by CloudFlare and replace the Godaddy NameServers.

Follow exactly the sequence of the NameServers given by CloudFlare and then click the “Save” button to save your new NameServer settings.

Godaddy will then notify you about the changes of your NameServers and usually, it will just take a few minutes to propagate your domain name’s new NameServers.

Step 4:  Recheck CloudFlare

Click on the “Recheck Nameservers” button after few minutes.

Congratulations! CloudFlare free plan is now Active for “Ipaskil.com” domain name.  Few settings I would like to configure which is decent enough to fully functional site using CloudFlare.

And the best part? is that we have a free SSL which is by default a Flexible provided by CloudFlare and it’s free as always.  Don’t modify those settings as we’re only using a free plan from CloudFlare, it’s good enough for us already.

Step 5:  Modify CloudFlare DNS Records

Head over to DNS menu tab from your CloudFlare dashboard and modify the default configuration which has captured by CloudFlare earlier from Godaddy DNS settings.

Now, I modify exactly of what I want for my CloudFlare DNS Records.  I’ll explain for you of why I came up with this settings.

Type A:  The “A” record for the domain name “ipaskil.com” must point to my Linode Cloud hosting which is my current web server IP address.  The Status should be orange cloud icon to use the complete CloudFlare network solution.

Type A:  For the “mail” IP Address, right now I’m using HostGator shared hosting for my email usage only.  The Status should be grayed cloud icon to use DNS only.

HostGator Web Hosting

CNAME:  By default, it’s there and usually inherited from the “A” record of ipaskil.com, no need to change this setting.  The Status should be orange cloud iconto use the complete CloudFlare network solution.

MX: You must add this setting so you can receive emails when someone sent an email that ends with @ipaskil.com and the value should be “0” zero for the highest priority and the maximum of 10 only.

Step 6:  Extra Recommend Settings for CloudFlare

Under “Crypto” menu tab, click that one and we’re about to turn on 2 things from there as I recommend it as a free plan for CloudFlare and turn on this button.

The 2nd setting that I would like you to turn it on still under “Crypto” menu tab and that’s all from this menu tab.

Under “Speed” menu tab, only this setting I recommend you to tick those checkboxes. 

This is very important as well because all your pages will be minified and reduce page file size and it’s good for your Search Engine Optimization (SEO) which speed is one of the factors for better rankings.

Under “Page Rules” menu tab, might be optional for you but I really don’t want to see www. at the start of my domain name as my personal preference, so just in case you want this setting under page rule, you may follow on this as well, if not you can just skip this page rule.

Click on the “Create Page Rule” button and follow this guide to remove www. from your domain name.

After filling up your settings of course you must change ipaskil.com with your own domain name. 

Try accessing, www.ipaskil.com and it will auto remove the www. and redirected permanently with 301 redirects which you’re telling the search engines that “Hey, I’m moving this site without www. and please index it accordingly” and that’s how the page rule we’ve just created earlier works efficiently as expected.

Aside from removing the www, you’ve noticed that the Flexible SSL provided by CloudFare works as well.  Awesome right?

Congratulations! we’re done the configurations for “Ipaskil.com” with the best recommendations to secure our web server under CloudFlare technology free as always.

Do you remember in our last event loop about How to Install NGINX on Ubuntu 18.04?

Last time we’re accessing our web server using an IP Address like http://172.104.190.249 isn’t? now, we use our domain name instead of the IP Address, that’s great!

In the next event loop on {{ PLP }}.

Wow, amazing we’ve done a lot for today guys.  Up next, we’re about to start the Basics of Python Programming with Django framework.  Are you getting excited? Stay tuned for more!

See you in the next event loop on The Essence of Python 3.6+ with Django 2.1+ Framework.

That’s all, have fun learning with {{ PLP }}.

To help Filipino students to learn Python programming language with Django to enhance their capabilities in developing robust web-based applications with practical and direct to the point tutorials, step-by-step with actual information that I provided for you. Leave a comment below or email me at [email protected], thank you!