Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
* Aut 05 2016 CloudFlare Inc <[email protected]> - 2016.8.0
* Oct 24 2016 CloudFlare Inc <[email protected]> - 2016.10.0
- Change OS detection for EasyApache 4 installer to work with CentOS < 7

* Aug 05 2016 CloudFlare Inc <[email protected]> - 2016.8.0
- Updated CloudFlare IPv6 ranges
- Support for installing on EasyApache4

Expand Down
17 changes: 5 additions & 12 deletions EasyApache/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ function install_ea3 {
function install_ea4 {

#
# Reasonably reliable way to get OS distribution name and version
# Get OS version from redhat-release
#
DISTRO_NAME=`cat /etc/os-release | grep "^NAME" | sed 's/NAME="//' | sed 's/"//'`
DISTRO_VERSION=`cat /etc/os-release | grep "^VERSION_ID" | sed 's/VERSION_ID="//' | sed 's/"//'`
DISTRO_NAME=`cat /etc/redhat-release | awk {'print$1'}`
DISTRO_VERSION=`cat /etc/redhat-release | sed -e 's/.*release \(.*\) (.*)/\1/' -e 's/\..*//'`

# Remove trailing minor version
DISTRO_VERSION=`sed "s/\..*//" <<<"$DISTRO_VERSION"`

if [[ $DISTRO_VERSION == "6" || $DISTRO_VERSION == "7" ]]; then
echo
Expand Down Expand Up @@ -97,13 +95,8 @@ function install_ea4 {
# Main
#

#
# Check which version of cPanel we have
#
CPANEL_VERSION=`/usr/local/cpanel/cpanel -V | sed "s/\..*$//"`

# Version 58 and up have Easy Apache 4
if [ "$CPANEL_VERSION" -gt "57" ]; then
# Check if EasyApache 4 is enabled
if [ -e "/etc/cpanel/ea4/is_ea4" ]; then
install_ea4
else
install_ea3
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,30 @@ This specifies the header which contains the original IP. Default:

### CloudFlareRemoteIPTrustedProxy ###

This is the IP range from which we will allow the `CloudFlareRemoteIPHeader` to be used from. See [here][1] for a complete list.
This is to add additional trusted IP addresses or ranges from which we will allow `CloudFlareRemoteIPHeader` to be used from. We will rewrite remote IPs and the SSL variable (in the case of Flexible SSL) from these trusted IPs, additionally `DenyAllButCloudflare` will not deny requests from IPs listed here. See [here][1] for a complete list.

### DenyAllButCloudFlare ###

When this is set, we will deny requests from IPs which aren't in the `CloudFlareRemoteIPTrustedProxy` directive or are not from a Cloudflare IP.

Note that by default, `DenyAllButCloudflare` will not allow Remote IPs, they will need to be whitelisted through `CloudFlareRemoteIPTrustedProxy`.

## Loading the Module ##

Note that on some 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.

## Installing apxs/apxs2 ##

If you cannot find `apxs` or `apxs2`, install `apache2-dev` on Debian and Ubuntu, or `httpd-devel` on Red Hat and CentOS:

$ apt-get install apache2-dev
$ yum install httpd-devel

NOTES:
## Additional Notes ##

- 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.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MAJOR=2016
MINOR=8
MINOR=10
BUILD=0
7 changes: 4 additions & 3 deletions mod_cloudflare.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
* Derived from mod_remoteip.c.
* Default values for directives are hard-wired for CloudFlare defaults.
*
* Supported directives and defaults:
* Supported directives and example values (further info in README):
*
* CloudFlareIPHeader CF-Connecting-IP
* CloudFlareIPTrustedProxy 204.93.173.0/24
* CloudFlareRemoteIPHeader CF-Connecting-IP
* CloudFlareRemoteIPTrustedProxy 204.93.173.0/24
* DenyAllButCloudFlare
*
*/

Expand Down