Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
varnish + libvmod-geoip
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
hydrapolic
Tux's lil' helper
Tux's lil' helper


Joined: 07 Feb 2008
Posts: 114

PostPosted: Tue Dec 10, 2013 2:34 pm    Post subject: varnish + libvmod-geoip Reply with quote

varnish (https://www.varnish-cache.org/)
Varnish is a web application accelerator. You install it in front of your web application and it will speed it up significantly.

libvmod-geoip (https://github.com/lampeh/libvmod-geoip)
This Varnish module exports functions to look up GeoIP country codes in VCL.

Sometimes, you need to serve different content to people from different countries. Varnish has no built-in functionality to add the country header when sending requests to the backends. Luckily, we can use some of the vmods that link varnish with geoip.

1) get libvmod-geoip ebuild
https://github.com/hydrapolic/gentoo/tree/master/www-servers/libvmod-geoip

2) emerge libvmod-geoip

3) edit /etc/varnish/default.vcl

import geoip;

backend default {
.host = "backend.example.com";
.port = "80";
}

sub vcl_recv {
set req.http.X-Country-Code = geoip.client_country_code();
}

From now on, the backend will have the header X-Country-Code set to the country from which the request came from.
Back to top
View user's profile Send private message
vguardiola
n00b
n00b


Joined: 15 Jun 2004
Posts: 8

PostPosted: Tue Jul 08, 2014 1:21 pm    Post subject: Reply with quote

HI, I just finish complie the lib but when I tty to restart varnisd and I get this error:

Quote:
varnishd | * varnishd has detected an error in your setup:
varnishd |Message from VCC-compiler:
varnishd |Could not load VMOD geoip
varnishd | File name: /usr/lib64/varnish/vmods/libvmod_geoip.so
varnishd | dlerror:: /usr/lib64/varnish/vmods/libvmod_geoip.so: undefined symbol: W_Dup
varnishd |('input' Line 2 Pos 8)
varnishd |import geoip;
varnishd |-------#####-



some Idea?
_________________
----
Victor Guardiola
http://www.masquesoft.net
http://www.masquelinux.net
http://www.masquejuegos.net
http://www.masquewireless.net
http://www.rubiwireless.net
Back to top
View user's profile Send private message
hydrapolic
Tux's lil' helper
Tux's lil' helper


Joined: 07 Feb 2008
Posts: 114

PostPosted: Thu Jul 10, 2014 12:38 pm    Post subject: Reply with quote

The ebuild is made for Varnish 3.0.5, is that the version of Varnish which you have installed? (VARNISH_VERSION="3.0.5")
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum