Setting up Cloudflare in cPanel Guide
The CloudFlare plugin comes pre-installed on our Shared and Business hosting packages and can be accessed via the Software section in cPanel.
If you’re on a Cloud or Dedicated server you’ll need to install the plugin using the steps below.
Note: You’ll need an account with Cloudflare to utilize this plugin.
Note: Install using a Secure Socket Shell client like Putty.
- Using the root user, access the server via SSH
- Issue the following while logged in via SSH
1curl -s https://raw.githubusercontent.com/cloudflare/CloudFlare-CPanel/master/cloudflare.install.sh -k HOST_API_KEY -n ‘YOUR_COMPANY_NAME’
HOST_API_KEY will look similar to 56yt8x9s987dfy4324bnv ‘YOUR_COMPANY_NAME’ should be surrounded by single quotes like ‘Hostwinds’
- This begins your installation of Cloudflare. cPanel plugin files will begin first, then mod_cloudflare. Depending on the server load time will take between a few seconds and 5 minutes. The process will be complete when you see, Cloudflare module installed successfully.
- Cloudflare has now been added to your server. The process needs to be repeated for additional servers. Ignore if you have automatic update script running.
- When finished with the installation you should see the message:
“Plugin installed ok, Cleaning up”
How do I Configure Cloudflare?
The plugin gives you two options for how to use the service.
- CNAME Setup – The authoritative DNS will continue to point to the customer’s domain. Subdomains will only be pointed to Cloudflare. CNAME only allows protection at a subdomain level, for example, admin.example.com versus example.com.
- Full DNS Setup – You must make Cloudflare the authoritative DNS by pointing your domain’s name server to their name server. By adding full DNS provisioning you allow root domain and subdomain protection throughout the website.
Partners dictate if they wish to allow Full DNS zone setup for clients and customers. N.B CNAME setup cannot be disabled. Here are the various ways Cloudflare can be enabled.
- Default option – CNAME setup only
- CNAME and Full DNS setups
You can configure this by editing the config.js. Find it here:
Then update this parameter:
“featureManagerIsFullZoneProvisioningEnabled”: false – Full DNS disabled (all customers will use CNAME) or featureManagerIsFullZoneProvisioningEnabled”: true