mod_cloudflare doesn't work with successful installtion!

Started by dadashali, March 02, 2016, 12:46:09 AM

Previous topic - Next topic

dadashali

Hi,
I installed "mod_cloudflare" successful on CWP that use apache web server via this link: https://support.cloudflare.com/hc/en-us/articles/203656534-How-can-I-set-up-Apache-mod-CloudFlare-
After this all i see visitors ip still are not their real ip ... and im sure the module is active on my VPS. You can see it on attached screen shot.
Any idea how to fix this matter?

Regards



Darkroom

Are you running varnish? That's usually the culprit when it comes to Apache is logging the server's own IP as the source of all traffic.

dadashali

No its Apache only with out any thing else but as i said i used "mod_cloudflare" as a module that work like a cache and change the user IP to it's own.

Regards

Sandeep


aicon

Does not work with cwp7
I tried all solutions from the forum and from google results
With apache only selected returns the cloudflare IP
with apache + nginx returns the server IP
some with varnish or all 3
maybe someone know the solution
In case anyone wants $10 bonus for FREE on cheap cloud VPS from Vultr:
http://www.vultr.com/?ref=6855695
-------------------------------------------------------------------------------------------------
And $10 bonus for FREE on cheap cloud VPS from Digitalocean:
https://www.digitalocean.com/?refcode=c41029801394

locvfx

Quote from: aicon on February 11, 2017, 07:15:12 AM
Does not work with cwp7
I tried all solutions from the forum and from google results
With apache only selected returns the cloudflare IP
with apache + nginx returns the server IP
some with varnish or all 3
maybe someone know the solution

May I ask what's the reason you need to see visitor's ip
I suggest not to use cloudflare. It's annoying, dont trust their words (If you are using Free plan)
Have you try Mod GeoIP

Quoteyum -y install geoip-devel
cd /tmp
wget http://pecl.php.net/get/geoip-1.0.8.tgz
tar -zxvf  geoip-1.0.8.tgz
cd geoip-1.0.8
/usr/local/bin/phpize
./configure --with-php-config=/usr/local/bin/php-config
make
make install
3. After "make install" command execution done you will get a line stating the shared extension directory path. For Example : some text /usr/lib64/extensions/no-debug-non-zts-20131226
4. Copy that directory path only. Then go to your php.ini file editor.
5. Go to the bottom of the file and paste : extension_dir = the path you copied from the make install completion.
6. After the extension_dir line put : extension=geoip.so
7. Restart Apache and to verify the module, use this command : php -m




Sandeep

use this commands for el7

yum install libtool git -y

git clone https://github.com/cloudflare/mod_cloudflare.git && cd mod_cloudflare

/usr/local/apache/bin/apxs -a -i -c mod_cloudflare.c

systemctl restart httpd && /usr/local/apache/bin/httpd -M|grep cloudflare


djingibi

I found the problem. Add to apache config file (/usr/local/apache/conf/httpd.conf)

this line:

CloudflareRemoteIPTrustedProxy 123.123.123.123

Replace "123.123.123.123" with your server's IP.