mod_remoteip not working

klasje

Verified User
Joined
Jan 5, 2008
Messages
52
I modified /etc/httpd/conf/extra/httpd-includes.conf
and added:
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy 10.10.10.10

I also added RemoteIPHeader X-Forwarded-For via the admin panel in the custom httpd configuration,
but still the $_SERVER['REMOTE_ADDR'] remains the ip of the application gateway (proxy).
I also issued a build rewrite_configs from custombuild, but it doesn't solve it.

In phpinfo(); I can see the X-Forwarded-For is correctly populated with the real user ip.

When root, executing:
httpd -l | grep mod_remoteip.c
I get:
mod_remoteip.c
(The output is in red?) but the module is available and loaded.

In phpinfo() there is nothing mentioned of remoteip, so is the module correctly loaded?
I'm using apache 2.4 so it should be present by default...

What am I missing?

I want the directadmin log tail of the access logs to correctly display the real user ip.
 
Small update for people using google: I still haven't found a solution.
 
Assuming you verified the remoteip module is loaded or built-in, paste below to a .conf file under /etc/httpd/conf/extra:
Code:
<IfModule remoteip_module>
    RemoteIPInternalProxy 127.0.0.1
    RemoteIPInternalProxy ::1
    RemoteIPHeader X-Forwarded-For
</IfModule>
 
Back
Top