Be sure to check out our developer page for resources for developing apps and other APIs.
From this page you may download many different tools and plugins for working with CloudFlare. You can also find resources for developing apps and other APIs at developers.cloudflare.com.
Based on mod_remoteip.c, this apache extension will replace the remote_ip variable in user's logs with the correct remote_ip sent from CloudFlare. This also does authentication, only performing the switch for requests originating from CloudFlare IP ranges.
# apxs2 -a -i -c mod_cloudflare.c
No further configuration is needed. However, if you wish to override the default values, the following directives are exposed:
This specifies the header which contains the original IP.
Default:
CloudFlareRemoteIPHeader CF-Connecting-IP
This is the IP range from which we will allow the CloudFlareRemoteIPHeader to be used from.
Default:
CloudFlareRemoteIPTrustedProxy 204.93.240.0/24
CloudFlareRemoteIPTrustedProxy 204.93.177.0/24
CloudFlareRemoteIPTrustedProxy 199.27.128.0/21
CloudFlareRemoteIPTrustedProxy 173.245.48.0/20
CloudFlareRemoteIPTrustedProxy 103.21.244.0/22
CloudFlareRemoteIPTrustedProxy 103.22.200.0/22
CloudFlareRemoteIPTrustedProxy 103.31.4.0/22
CloudFlareRemoteIPTrustedProxy 141.101.64.0/18
CloudFlareRemoteIPTrustedProxy 108.162.192.0/18
CloudFlareRemoteIPTrustedProxy 190.93.240.0/20
CloudFlareRemoteIPTrustedProxy 188.114.96.0/20
CloudFlareRemoteIPTrustedProxy 197.234.240.0/22
CloudFlareRemoteIPTrustedProxy 198.41.128.0/17
Note that on some Debian systems, you may have to add a LoadModule directive manually.
This should look like:
>LoadModule cloudflare_module /usr/lib/apache2/modules/mod_cloudflare.so
Replace /usr/lib/apache2/modules/mod_cloudflare.so with the path to mod_cloudflare.so on your system.
If you cannot find apxs or apxs2, on a Debian or Ubuntu distro you can install this tool with:
# apt-get install apache2-prefork-dev
If mod_cloudflare and mod_remoteip are enabled on the same web server, the server will crash if they both try to set the remote IP to a different value.
Enabling mod_cloudflare will not effect the performance of Apache in any noticeable manner. AB testing both over LAN and WAN show no equivalent numbers with and without mod_cloudflare.
If you like, you may also add the directive DenyAllButCloudFlare. This will result in all requests from IPs which are not in the CloudFlareRemoteIPTrustedProxy range being denied with a status of 403.
Railgun ensures that the connection between your origin server and each CloudFlare data center is as fast as possible. It does this by using an array of techniques to accelerate the HTTP connections between CloudFlare and your servers. Railgun is available for Business and Enterprise users. Learn more about Railgun.
Installation instructions are available here.
The use of Railgun on your own server requires a Business or Enterprise subscription and a 64-bit architecture.
A port of ddclient, this includes support for using the CloudFlare dynamic DNS updating system.
Perl 5.004 or later (you need the IO::Socket::SSL perl library for ssl-support)
cp ddclient /usr/sbin/
mkdir /etc/ddclient
mkdir /var/cache/ddclient
cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf
vi /etc/ddclient/ddclient.conf
—and change hostnames, logins, and passwords appropriately
For CloudFlare, this should be:
##
## CloudFlare (cloudflare.com)
##
ssl=yes
protocol=cloudflare, \
server=www.cloudflare.com, \
login=[email protected] \
password=my-cloudflare-api-key \
my-awesome-site.com,
To run in debug mode:
ddclient -daemon=0 -debug -verbose -noquiet
See the docs here for full configuration and installation instructions.
CloudFlare plugin for CPanel. Please note: The cPanel plugin is for Certified CloudFlare Hosting Partners.
Using an SSH client such as Terminal or Putty:
Step 1. Access cPanel for the server using root user by:
ssh root@SERVER IP ADDRESS or SERVER NAME
Step 2.
cd /usr/local/cpanel
Step 3.
curl -k -L https://github.com/cloudflare/CloudFlare-CPanel/tarball/master > cloudflare.tar.gz
Step 4.
tar -zxvf cloudflare.tar.gz
This extracts a directory that includes a UNIQUE ID. For example, the directory will be in this format:
cloudflare-CloudFlare-CPanel-d03f3b8
The UNIQUE ID is only: d03f3b8
The UNIQUE ID is not cloudflare-CloudFlare-CPanel-d03f3b8
Step 5.
cd cloudflare-CloudFlare-CPanel-UNIQUE ID/cloudflare/
Step 6.
./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).
Now that CloudFlare is installed, you can remove some of the unnecessary remnant files:
Step 9.
cd ../ ../Step 10.
rm -rf cloudflare-CloudFlare-CPanel-UNIQUE ID*
cat etc/cloudflare.json
You should see an output with the following:
root@server1 [/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”
}
CloudFlare is available for Plesk 10.4 and Plesk 11. The will plugin gives your customers a choice of installing CloudFlare Free or CloudFlare Performance Plus. For additional information refer to Parallels partners.
Install as a standard APS package, from the Tools and Settings panel of your Plesk 10.4 or Plesk 11 control panel. Note, this module requires the CloudFlare Parallels Engine to be installed first. Download installation guide.
Step 1: Enter the ISPmanager control panel - go to the Server Settings module - the Plug-Ins section. Then, click the Install icon in the upper corner of the toolbar.

Step 2: In the Plug-ins collection section you can choose a plug-in that you want to install from the available collection of plug-ins. You can also view information about a plug-in, such as its author, programming language that was used to write the plug-in, its functions and other information.

Step 3: If you want to install the CloudFlare plug-in, select it from the list and click the "Install" icon. A new from will be displayed. Carefully read the information in the form before installation.

Step 4: Once the installation is complete, the plug-in will be added into the Plug-in management module.

Step 5: To learn information about a plug-in, select one and click the "Info" icon. The following form will be displayed:

This document explains in detail the semantics of the function calls you can make using the Hosting Provider API service. This service is limited to access by web hosting providers who have agreed to the required license terms.
yadaDROP LLC, a Drupal Development company, has developed a CloudFlare module for Drupal. By using the CloudFlare Drupal Module, you receive:
This module only provides original IP at the CMS level. If you need original visitor IP at the server level, please install mod_cloudflare
The CloudFlare WordPress Plugin ensures your WordPress blog is running optimally on the CloudFlare platform.
CloudFlare has developed a plugin for WordPress. By using the CloudFlare WordPress Plugin, you receive:
The main purpose of this plugin is to ensure you have no change to your originating IPs when using CloudFlare. Since CloudFlare acts a reverse proxy, connecting IPs now come from CloudFlare's range. This plugin will ensure you can continue to see the originating IP.
This plugin can also help to ensure your server database is running optimally. If you are going to run the Database Optimizer associated with this plugin, then run it at a low traffic time. While the database optimizer is running, your site will go into Read Only mode, which means that you or your visitors will not be allowed to post. The optimizer should run quickly. Once the optimizer is done running, you will be able to post to your site again.
Every time you click the 'spam' button on your blog, this threat information is sent to CloudFlare to ensure you are constantly getting the best site protection.
We recommend that any user on WordPress and CloudFlare should use this plugin.
Upload the CloudFlare plugin to your blog, activate it, and you're done!
This should reveal visitor IPs to Joomla! No additional configuration is required
Joomla! 1.7, 2.5
You may be required to use a Joomla! legacy extension for the extension to work. This extension only provides original IP at the Joomla! level. If you need it at the server level, please install mod_cloudflare
Create a directory for the HTTP Module. Example:
C:\> md c:\HttpModules
Copy the files from the Release build of your target platform (x86 for 32-bit or x64 for 64-bit). Example:
C:\> xcopy <zip_dir>\x64\Release\* c:\HttpModules
Copy the Install-XFF-ps1 PowerShell script to the target directory. Example:
C:\> xcopy <zip_dir>\Install-XFF.ps1 c:\HttpModules
Change directory to the install path
C:\> cd c:\HttpModules
Register the Module with the install script (or via IIS admin).
C:\HttpModules\> .\Install-XFF.ps1 -cmd install -module_path c:\HttpModules\F5XFFHttpModule.dll
The module should now be installed in your top level IIS server Module settings as well as each existing application. You can selectively add/remove them from the IIS admin at this point.
The F5 XFF Http Module supports a configuration file named F5XFFHttpModule.ini. It looks in the same directory as the configured .DLL for a file of the same name as it self with the .INI extension. An example file is included but renamed to F5XFFHttpModule.ini.bak. Once you get rid of the ".bak" extension and restart the application the settings will take effect. In this configuration file, you should override the default header name of X-Forwarded-For to CF-Connecting-IP.