I’ve been struggling to get this working in a way to log the requesting client IP and not the load-balancer IP when the server is behind an AWS load-balancer. In the end it was very simple:
As /etc/apache2/mods-enabled/remoteip.conf
RemoteIPHeader X-Forwarded-For
Then edit /etc/apache2/apache2.conf
Change: LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined To: LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
And that was it. The default install (on Ubuntu 14.04 alpha) didn’t have a remoteip.conf but this may change as it comes out of alpha, in which case the file will be in /etc/apache2/mods-available and symlinked from ../mods-enabled. No RemoteIPInternalProxy directive was needed as 10.0.0.0/8 IPs seem to be picked up by default, and this is what Amazon uses internally.
0 Comments.