Note: This guide is for Chevereto 2.X, if you are running Chevereto 3.X you only need to go to your Dashboard > Settings > External services and enable CloudFlare.
This guide will help you to proper setup CloudFlare on your Chevereto website. CloudFlare is a reverse proxy that will make your website more secure and more faster. It will also help you to save bandwidth and server resources. Please notice that in order to use this service you must sign up to CloudFlare (free). Once you have your account just login and follow this steps.
1. Add your website to CloudFlare
- Go to My Websites and enter your domain name and then click on "Add website".
- CloudFlare will scan your records, just wait like 60 seconds.
- Once it finish the scan it will show you all your subdomains and MX records. All the records with this icon
- Click continue, then use this settings (recommended). Keep in mind that you can change it later.
- Then, you will need to change your DNS to point CloudFlare. Just to to your domain register and change the DNS to NS1: roxy.ns.cloudflare.com NS2: todd.ns.cloudflare.com and delete any extra DNS record.
In this step we will disallow caching on the files that we don't need to cache. This is the important part of the guide because if you don't do this you will see cached version of the dynamic files.
- Go to My Websites and click on this icon
- In page rules enter this 3 rules:
- URL Pattern: /*.php
- Forwarding: OFF
- Custom caching: Bypass Cache
- Always Online, Performance and Security set ON
- URL Pattern: /admin*
- Forwarding: OFF
- Custom caching: Bypass Cache
- Always Online, Performance and Security set ON
- URL Pattern: /.htaccess
- This is actually just in case you edit a lot the .htaccess
- Forwarding: OFF
- Custom caching: Bypass Cache
- Always Online, Performance and Security set ON
CloudFlare will mask the user real IP. To get the real user IP go to includes/config.php and replace this:
PHP:
//$_SERVER['REMOTE_ADDR'] = (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"];
PHP:
$_SERVER['REMOTE_ADDR'] = (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"];
That's all, you don't need anything else. Now you can:
- Monitor your stats and get a summary of your site
- Manage blocks by IP, IP range, Country, etc.
- Purge the cache (useful when you made some change and it never changes)
- A bunch of asdf tools and options
Last edited: