The CloudFlare cPanel plugin makes it easy to integrate into your hosting control panel. It takes less than 5 minutes to install on a test server and then the service is available to your end customers with two clicks.
Before proceed to install cloudflare plugin, you should get HOST KEY from cloudflare partners
Install cloudflare cpanel plugin Using an SSH client such as Terminal or Putty:
Step 1. Access cPanel for the server using root user by:
ssh [email protected] IP ADDRESS or SERVER NAME
curl -k -L https://github.com/cloudflare/CloudFlare-CPanel/tarball/master > cloudflare.tar.gz
tar -zxvf cloudflare.tar.gz
This extracts a directory that includes a UNIQUE ID. For example, the directory will be in this format:
The UNIQUE ID is only: d03f3b8
The UNIQUE ID is not cloudflare-CloudFlare-CPanel-d03f3b8
cd cloudflare-CloudFlare-CPanel-UNIQUE ID/cloudflare/
./install_cf API HOST KEY mod_cf “YOUR COMPANY NAME”
example for Awesome Hosting Company: ./install_cf 56yt8x9s987dfy4324bnv mod_cf “Awesome Hosting”
Step 7. This will start the installation. cPanel is installed first, followed by mod_cloudflare. Depending on your server, it will take between 15 seconds and 4 minutes. You know it will be done when you see:
CloudFlare module installed successfully
Step 8. CloudFlare is now successfully added to this server. You need to repeat the process for each additional server (unless you have an automatic update script).
Best SysAdmin practices
Now that CloudFlare is installed, you can remove some of the unnecessary remnant files:
cd ../ ../
This takes you back two levels.
rm -rf cloudflare-CloudFlare-CPanel-UNIQUE ID*
To check if it is installed:
You should see an output with the following:
[email protected] [/usr/local/cpanel]# cat etc/cloudflare.json
“host_key”:”32yt5a7b436tuy8974tre -”, (For security purposes, this will not be your host key.)
To ensure that CloudFlare was properly installed, enable CloudFlare for three test websites from your control panel.
To check if a website is on CloudFlare, use Terminal. Open Terminal, and enter the following dig command.
Output without CloudFlare-enabled:
Output with CloudFlare-enabled:
If you see ‘.cdn.cloudflare.net’ at the end, then CloudFlare is enabled.