Geolocation without compiling Varnish from source
spam at onlineconcepts.com
Tue Mar 26 19:00:12 CET 2013
I would like to geolocate our website visitors by country. Varnish can
send the ISO country code to our backend, which will then serve the users
content specific to their region of the world.
We're running Red Hat Enterprise Linux 6.2 (RHEL).
"varnishd -V" produces:
varnishd (varnish-3.0.2 revision 55e70a4)
STEPS TAKEN THUS FAR
I'm attempting to follow the solution described here.
1) Installed the MaxMind Geolocation API for C
2) Installed the MaxMind Binary GeoIP Country DB
3) Downloaded GeoIP Plugin for Varnish per
I don't think #3 is the solution we ultimately want to use, but running
"make test" produced the following output, indicating that the MaxMind
Geolocation API is probably (?) installed correctly.
220.127.116.11 => IT (OK)
18.104.22.168 => US (OK)
22.214.171.124 => GB (OK)
126.96.36.199 => NO (OK)
192.168.0.1 => Unknown (OK)
(null) => Unknown (OK)
I'm more of a developer than a Linux sysadmin. I would like to continue to
maintain Varnish versions using standard yum commands, rather than
compiling from source.
I followed these instructions https://github.com/guybedford/varnish-geoip
and then ran this command.
varnishd -f /etc/varnish/default.vcl -p 'cc_command=exec cc -fpic -shared
-Wl,-x -L/usr/local/lib -lGeoIP -o %o %s'
This produces an error.
Message from dlopen:
Compiled VCL program failed to load:
./vcl.8BAo5_pH.so: undefined symbol: vcl_geoip_set_header
Running dlopen failed, exit 1
VCL compilation failed
I found the links below useful, but none of them fixed my problem. The one
solution I have not tried is creating a VMOD because it seems to require
Thanks for any advice,
More information about the varnish-misc