Configure Apache2 logs for your TierHive backend

Summary

You might have encounted an 10.0.0.x origin IP in your apache2 logs.

Apache2 webserver won't natively provide you with the origin IP as the VPS is "hidden" behind our HAProxy server. In that article we'll configure apache2 webserver to collect the IP from the original request.

Real IP issue

Modify your /etc/apache2/apache2.conf file using vim or nano to add the following lines in the logging Settings section

Adjust according to your distribution, ex /etc/apache2/apache2.conf becomes /etc/httpd/conf/httpd.conf in RH distributions.

  RemoteIPHeader X-Forwarded-For
  RemoteIPInternalProxy 10.0.0.0/24

End result

/etc/apache2/apache2.conf:

# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#

RemoteIPHeader X-Forwarded-For
RemoteIPInternalProxy 10.0.0.0/24

Restart

Load the module and restart your apache2 server

If you are using systemd:

a2enmod remoteip
systemctl restart apache2.service

Please note that some request will still appears in your logs under the 10.0.0.x IP, the HAProxy is checking if your server still responds.