Fix REMOTE_ADDR so it reports correct IP instead of server IP in PHP

Here are the exact steps we follow:

1) Login in to destination server

2) wget ""

3) Rename download file to custom_opt_mod-remoteip.tgz (mv custom_opt_mod-remoteip.tgz?version=11&modificationDate=1460059683458&api=v2 custom_opt_mod-remoteip.tgz)

4) tar -C /var/cpanel/easy/apache/custom_opt_mods -xvf custom_opt_mod-remoteip.tgz

5) Run /scripts/easyapache

6) Check box next to Mod Remote IP

7) Rebuild Apache/PHP (/scripts/easyapache --build &> /tmp/build.log)

8) Edit /usr/local/apache/conf/includes/pre_global_main.conf

9) Add: Include "/usr/local/apache/conf/mod_remoteip.conf"

10) Open mod_remoteip.conf and add:

a) Varnish Plugin:? RemoteIPHeader X-Forwarded-IP

b) Varnish Nginx Plugin:? RemoteIPHeader X-Real-IP

11) Restart Apache
  • 11 Kunder som kunne bruge dette svar
Hjalp dette svar dig?

Relaterede artikler

Stop worpress wp-login.php brute force attacks with Varnish throttling (Rate Limit)

Version 1.8.4 of the cPanel Varnish Plugin has seen a new feature being introduced: the ability...

Varnish Plugin on Amazon AWS with Elastic IP or NAT

Here are the two short steps required to ensure licensing is setup properly so you're able to use...

Correct IP reporting in legacy software / scripts

The plugin follows reverse proxy software proper handling of X-Forwarded-For headers and in this...

vBulletin correct reporting of IP address

It's recommended to make the following changes to includes/config.php so vB doesn't report...