Geolocation without compiling Varnish from source

John spam at
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)

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.

Testing IPs: => IT (OK) => US (OK) => GB (OK) => NO (OK) => 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
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:
  ./ 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
recompiling Varnish.

Thanks for any advice,

More information about the varnish-misc mailing list