0

I'm on a projet where I have to implement GeoIP on a Redhat Apache instance. For now, i'm only testing the configuration in local. Here it is :

<IfModule mod_geoip.c>
  GeoIPEnable On
  GeoIPDBFile PATH_TO_LIB\GeoIP.dat
  GeoIPEnableUTF8 On
  GeoIPOutput All
</IfModule>

Idea/Hypothesis : I want to test the outputs of the librairy and change it to link localhost to different country. In Other words :

193 => France

Will temporarly become in the library

127 => France

for testing purposes.

Question : How can I know that the library GeoIP.dat is called ? Has anyone tested it this way before ?

Thanks,

Ismail H
  • 107
  • 7

1 Answers1

0

Test it through a proxy which allows you to pick countries or a VPN service like BlackVPN, HideMyAss etc. which also allow you to pick countries. Your connection will then be masked as if it came from that country and your server should respond accordingly.

To test it without an external connection to it, you have a few options as per this article (which focusses on Varnish and Drupal, but principle is the same): https://docs.acquia.com/articles/testing-geoip-headers

You can use .htaccess to try different headers, or spoof headers with CURL etc.

More info on spoofing the originating address here:

https://stackoverflow.com/questions/5092563/how-to-fake-serverremote-addr-variable

JayMcTee
  • 3,923
  • 1
  • 13
  • 22
  • That would have been perfect if my test were run from the server, but I'm doing it in localhost and I can't access my localhost trough a proxy. Except if I can create one locally, which I never did so far. – Ismail H Jan 07 '16 at 10:37
  • Expanded my answer, also see here: http://stackoverflow.com/questions/5092563/how-to-fake-serverremote-addr-variable – JayMcTee Jan 07 '16 at 11:30
  • Edited the answer to how I resolved the issue – Ismail H Jan 14 '16 at 15:44