Resolved How to install mod_cloudflare without extension?

omexlu

Regular Pleskian
Hello,

I used apache + nginx as proxy and i want to show the real-ip adresses in log-files.

How can i install mod_cloudflare without installing the extension on plesk, because i don't need them only the real ip adresses?

(Plesk onyx)

Also i want to configure fail2ban correctly that ip adresses get blocked.

Thanks
 
There are no problems if i installed this manuel? (i don't want servershield)

Code:
Option 4: Manual Installation: Debian / Ubuntu

mod_cloudflare has a few software dependencies that need to be installed first:

# apt-get install libtool apache2-dev
Note: If you find that you are unable to install apache2-dev then you should install:

# apt-get install libtool apache2-threaded-dev
Next, you should download the mod_cloudflare source to your server:

# wget https://www.cloudflare.com/static/misc/mod_cloudflare/mod_cloudflare.c
Finally, install the module. Depending on your system, the command to run might be apxs or apxs2. So, run one of the below two commands. If you get a 'Command not found' when running one, try the other:

# apxs -a -i -c mod_cloudflare.c
# apxs2 -a -i -c mod_cloudflare.c
 
There are no problems if i installed this manuel? (i don't want servershield)

Code:
Option 4: Manual Installation: Debian / Ubuntu

mod_cloudflare has a few software dependencies that need to be installed first:

# apt-get install libtool apache2-dev
Note: If you find that you are unable to install apache2-dev then you should install:

# apt-get install libtool apache2-threaded-dev
Next, you should download the mod_cloudflare source to your server:

# wget https://www.cloudflare.com/static/misc/mod_cloudflare/mod_cloudflare.c
Finally, install the module. Depending on your system, the command to run might be apxs or apxs2. So, run one of the below two commands. If you get a 'Command not found' when running one, try the other:

# apxs -a -i -c mod_cloudflare.c
# apxs2 -a -i -c mod_cloudflare.c

don't bother , I just tried , it didn't work , log still doesn't show real IP
don't know what went wrong
 
Maybe the helpfull user @UFHH01 can help here :)
Or can i install Servershield only for the mod_cloudflare and don't use the rest? Because i want to manage that trought cloudflare itself?

@qtwrk did you follow the exact steps in KB?
 
Last edited:
Maybe the helpfull user @UFHH01 can help here :)
Or can i install Servershield only for the mod_cloudflare and don't use the rest? Because i want to manage that trought cloudflare itself?

@qtwrk did you follow the exact steps in KB?

yes , fortunately my VPS has snapshot , so i tried twice , but still doesn't work out.
i followed it step by step ...
 
Or can i install Servershield only for the mod_cloudflare and don't use the rest? Because i want to manage that trought cloudflare itself?

Maybe i can do that, because i think this installs mod_cloudflare additionally?
 
Yes i know :D but i think installing the servershield extension install mod_cloudflare too.
But i want only install that if the configuration of servershield is not necessary because want to handle trought cf.

i just want because mod_cloudflare :)
 
Yes i know :D but i think installing the servershield extension install mod_cloudflare too.
But i want only install that if the configuration of servershield is not necessary because want to handle trought cf.

i just want because mod_cloudflare :)
good luck...
 
Yes i know :D but i think installing the servershield extension install mod_cloudflare too.
But i want only install that if the configuration of servershield is not necessary because want to handle trought cf.

i just want because mod_cloudflare :)

I managed , I missed something ,that's why it didn't work.

this is step:

1. Our technical resources | Cloudflare I tried way 1 and way 3. I installed twice which is kind of stupid , you should just use one way.
2. which is most important, place this content into /etc/nginx/conf.d/cloudflare.conf , file doesn't exist , you have to manually create.

Code:
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 199.27.128.0/21;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
real_ip_header CF-Connecting-IP;

https://www.cloudflare.com/ips-v4
https://www.cloudflare.com/ips-v6

IPs collected from here , you may have to update it from time to time.

code updated in 2017/04/28.

good luck
 
Request Header Or Cookie Too Large

if you got that error.

modify /etc/nginx/nginx.conf


client_header_buffer_size 1k;
to
client_header_buffer_size 32k;

and

large_client_header_buffers 2 1k;
to
large_client_header_buffers 4 32k;


change these 2 value to greater number , 32k and 4 32k is what i google'd out. I am not sure what exactly do they mean , but it works fine...
 
Last edited:
I installed ServerShield and this acivates mod_cloudflare the easyst way, don't need to use the other things of servershield.
 
Last edited:
Back
Top