How to install the CloudFlare Plugin for cPanel

How to install the CloudFlare Plugin for cPanel

Cloudflare is a system that can keep your website online by displaying a cached version of your site if your dedicated or VPS server goes offline. CloudFlare is also useful for mitigating DDoS attacks against your server. It’s simply to setup and usually, all you need to do is change a few records on your DNS file to get started. As an official partner of CloudFlare First2Host is allowing our users to deploy the plugin to your servers which will automate the setting up of CloudFlare, To do this you will need root access.

Login to your server and issue the below command, the CloudFlare Plugin will be deployed and installed.

bash <(curl -s https://raw.githubusercontent.com/cloudflare/CloudFlare-CPanel/master/cloudflare.install.sh) 5c75743c4eeee0ad94e4fc1bd3520e7e 'First2Host.co.uk'

You can verify the install by issuing

cat /usr/local/cpanel/etc/cloudflare.json

Free cPanel VPS License

You should then get an output like this

[email protected] [/usr/local/cpanel]# cat etc/cloudflare.json
{
“host_key”:”32yt5a7b436tuy8974tre -”, (For security purposes, this will not be your host key.)
“host_formal_name”:”Awesome Hosting”,
“host_name”:”api.cloudflare.com”,
“host_uri”:”/host-­gw.html”,
“user_name”:”www.cloudflare.com”,
“user_uri”:”/api_json.html”,
“host_port”:”443”,
“host_prefix”:”cloudflare-­resolve-­to”,
“cp_version”:”1.3.0”
}

If you use a custom theme for cPanel you can attach the CloudFlare Plugin to your theme by issuing the below command.

BASE_THEME should be either ‘x3’ or ‘paper_lantern’, based on what theme the alternate was based on.

Replace ALTERNATE_THEME with the folder name of the alternate theme on your server. This folder should be located at /usr/local/cpanel/base/frontend/ALTERNATE_THEME/.

bash <(curl -s https://raw.githubusercontent.com/cloudflare/CloudFlare-CPanel/master/copy2theme.sh) BASE_THEME ALTERNATE_THEME

How was this article?

How to install the CloudFlare Plugin for cPanel
How was this post?
cPanel VPS Server

cPanel Server Security

Select Language
We are currently updating our website. Please accept our apologies for any disruption you may see.
+