Sighthosting Blog News

How to setup Cloudflare on cPanel or Client Area (WHMCS)

Domain Name Servers (DNS) are the Internet’s equivalent of a phone book. They maintain a directory of domain names and translate them to Internet Protocol (IP) addresses. This is necessary because, although domain names are easy for people to remember, computers or machines, access websites based on IP addresses. CloudFlare is such a service provider which currently provides a free and/or paid service, of all theDNS providers CloudFlare is the easiest to configure and the most reliable it all depends on how important it is do have such a service enable on your website and domain. In this article we are going to show you how to set this up on your cPanel.

You can enable CloudFlare right through your Sighthosting cPanel , using the one-click activation or through your Client Area.

To activate CloudFlare on your HostPapa shared hosting account:

  1. Log in to your cPanel or through your dashboard
  2. Click on Client Area. If you have more than one domain associated with your HostPapa account, click on the appropriate domain link, then enter your cPanel password if required.
  3. Click on Services, Hosting then select your product “Active” button and you should then see the CloudFlare addon icon.
  4. If this is your first time accessing the CloudFlare interface, you will be asked to create an account. Provide your email address and agree to the terms of service once you have read them. You will then receive a welcome email by CloudFlare for your HostPapa account.
  5. Once your account is created, you will be taken to the CloudFlare interface which lists all of your account domains. By default, they will not be powered by CloudFlare.
  6. To enable CloudFlare for any domain, simply click on the cloud beside it. Once selected, CloudFlare will be enabled and the cloud will go from a greyed-out image to bright orange.
  7. Once enabled, you can select Statistics and Settings to view the traffic for your domain and also to modify the security settings. To view all of your available options, you must log in to your CloudFlare account directly.
  8. Your site is now CloudFlare enabled. To disable CloudFlare for any or all of your domains, simply select the orange cloud again and it will be greyed-out.

Note: CloudFlare does not modify the base A record for your domain (i.e. domain.com) and only modifies subdomains / CNAME records. If you want your base domain to be CloudFlare-enabled, you’ll need to have it redirect to www.yourdomain.com.

To do so: Add or modify your existing .htaccess file (usually located in /home/yourusername/public_html/.htaccess) and add the following lines:

 RewriteEngine On
 RewriteCond %{HTTP_HOST}^yourdomain.com [NC] # Replace with your actual domain
 RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301] # Replace with your actual domain