CloudFlare integration

TransAmDan

Forum Admin
Staff member
What is CloudFlare
Well its a bit like the MaxCDN we use. Any files the users had to download to view the webpage passes through their servers and is cached. A cached file gets served much quicker and reduced bandwidth on our web server. The CloudFlare is a CDN (Content Delivery Network) serves files from a central place and there are many of these places around the world.
However its configured different to our MaxCDN, the was that work is the URL is different Say for instance the logo a the top of the page is served from http://[B]cdn[/B].solent-renegades.co.uk/images/solent-renegades-logo.gif instead of WWW. Well cloudflare compliments this as it caches anything on www
It all seems very good and the starter package is probably all we need and its free. So going to try it for a month or so, and progress from there.
MaxCDN costs £60 a year, its been giving issues on gallery images (so not using MaxCDN for that at the moment) so perhaps the plan is to ditch MaxCDN in favour of CloudFlare. Performance testing is required.

How ever as all traffic passed though the CloudFlare servers, we cant track their real IP address they are coming from. Does this really matter? An article here shows how it works:- https://support.cloudflare.com/hc/en-us/articles/200170786

We use google Analytics so i can see where people have come from, this will not work correctly as everyones IP address is pretty much the same(CloudFlare IP's)
We also use Google AdSence, this generates a couple of quid a week to help with Server costs, however with this IP address translation its not working correctly, as its thinking all the users are on the same computer. If many of them do actually click, I'd probably get banned from google Adsence, its not good to click on adverts repeatedly, and with people looking like they are all on the same computer, this is how it would look to Google Adsence.

So to get around it, there is a mod patch called mod_cloudflare, which you can load onto the apache webserver to get around this.

[h=5]Description[/h]Because CloudFlare acts as a proxy, you will notice changes to the way that your website visitors' IP addresses are displayed both in your server logs and web applications - notably that all access appears to be coming from CloudFlare IP addresses. You can read more about the reasons for this in our knowledge base article.
You can change this behavior and log & display the actual visitor IP addresses by using mod_cloudflare.
[h=5]Requirements[/h]mod_cloudflare supports Apache httpd 2.2.x and 2.4.x. Installation requires root access to the command line of your server via SSH.
Note: if you use cPanel, follow the proper installation method below. However, if you are a hosting provider, you should install the CloudFlare cPanel plugin instead. Installing the CloudFlare cPanel plugin will automatically install mod_cloudflare. Note that using the CloudFlare cPanel plugin requires that you are a Certified Partner with a Host API Key. You can apply to be a Certified Partner here.
[h=5]Installation[/h]Please choose your desired installation method below. CloudFlare recommends using a manual installation unless you know that Apache httpd and its dependencies have all been installed to your server using your operating system's package management system (such as RPM or DEB) - i.e. not manually compiled and installed.
Option 1: Installation from Packages
Download the appropriate package to your web server and install it using your operating system's "rpm" or "dkpg" commands.
For RedHat / CentOS / CloudLinux:
# yum install glibc.i686
# rpm -i mod_cloudflare-elX.latest.rpmFor Debian / Ubuntu:
# dpkg -i mod_cloudflare-XXXXX.latest.deb

All seems to be working fine. So I'll carry on with the trial, and go from there. MaxCDN isn't due for renewal will about April time.
 
Last edited:
lol, I mainly write to much so when I read it back from the future I have a hint of what I was doing.

Basically, Does it feel faster?
 
I read like a few sentences and then stopped lol.

Is the forum faster? I haven't noticed, but then my PC seems to running slow this afternoon.
 
but then my PC seems to running slow this afternoon.
I was uploading a couple of videos on YouTube of the LED glitch of a display, so that would have had an impact on the whole companies internet. My Fault :p should be okay now.

Just running some pagespeed tests from other points in the world to see any improvements. I done a load test the other day, and it taken load off our web server, which may me I could downgrade the spec. Although 8Gb or RAM made a great improvement over 4Gb, so even if I downgrade the CPU speed I'll still stick with 8Gb RAM.
 
Yep, a lot quicker now.....


And with work internet, it was taking forever to type an ickle email!
 
I may disable CloudFlare shortly may be temporarily or permanently.

My main reason for using CloudFlare was to speed up the user experience, although it was already quick, but search engines like Google times how quick you pages low, the faster ones are more favorable at appearing in searches. So I wanted to make it as whizzy as possible.

However since moving to CloudFlare the visitors are still being registered in GoogleAdsence, but its returning less than 10% of when it was without CloudFlare.

There is a couple of reasons for this:-

  • CloudFlare can modify javascript to make it load faster, this is called RocketLoader, this is disabled anywaqy, so its not there.
  • CloudFlare makes it looks like visitors are coming from their server as you are basically viewin the website though their server. There is an add on called mod_cloudflare which you can install on Apache shown in the first post.

Both of these are configured correctly, however something is different according to Google. but what....
Found other posts on Google help, https://productforums.google.com/fo...e/cloudflare/adsense/hbM8Wev0IdI/eWCPTWHdoRIJ
Popped in my own thread/question:- https://productforums.google.com/fo...re|sort:date/adsense/GriKyJwcxcw/Igt5WBy7E34J

So hopefully more light will be shed on this.
Its quite difficult to get accepted by Google Adsence, and if you are banned you wont get back on. As this is what helps keeps the server going this is a chance I cant take.

Therefore, I will run without CloudFlare for a short time. See what happns to the stats.
 
Back
Top