Cpanel: Install mod_cloudflare


Now that I’ve put my site on CloudFlare, hopefully you will see a performance boost and site load time should drop.

Guys at Cloudflare directed me to read this document which I think was sort of a kick start on “How To with cloudflare?”

You can read that document here

This document helped me a lot in understanding the configurations and how to use CloudFlare control centre.

You must be aware that CloudFlare act as a proxy to your server thus all the IP addresses hitting your server would be CloudFlare’s IP addresses. Your access logs will start looking weird.

You should also read these documents

Now this post just tackle one specific problem i.e.



How to install mod_cloudflare under CPanel

Follow these steps

  1. Use putty or similar tool to connect to your server using SSH.
  2. Goto your home directory or goto /usr/local/src
  3. We will download the source code for mod_cloudflare now with the following command

  4. Above step will download file called mod_cloudflare.c
  5.  We will now use apxs (Apache Extension Tool) to install our mod_cloudflare with the following command

    Make sure that you have not changed your working directory

  6. Now we will restart our Apache service with the following command


  7.  Final step would be to update Apache Configuration and is done with the following command


Make sure that there is no error from any of the above step.

If you are not a system administrator then you should avoid doing it. But if you are a a techie and are confident enough then go ahead and do it. I also have compiled these instruction from elsewhere and did it without any issues. You may have to ask your hosting provider to do it for you on your server just in case you don’t have root access to your VPS.

Your Apache will now be recording right IP addresses to your log files. If it isn’t then you are missing a step from above steps.

I hope that this helps