Skip to content

b3cft/geoip-vmod

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

==========
geoip-vmod
==========

---------------------------
Varnish GeoIP Module
---------------------------

:Author: Lee Doolan

SYNOPSIS
========

import geoip;

DESCRIPTION
===========

This Varnish module lets you add VCL that sets the request header 
X-GeoIP to the requestor's geo (or Unknown).

Requires GeoIP library (on Debian install libgeoip-dev)

INSTALLATION
============

The source tree is based on autotools to configure the building, and
does also have the necessary bits in place to do functional unit tests
using the varnishtest tool.

Install the GeoIP library headers::

 apt-get install libgeoip-dev

To check out the current development source::

 git clone git://github.com/leed25d/geoip-vmod.git
 cd geoip-vmod; ./autogen.sh

Usage:

./configure VARNISHSRC=DIR

VARNISHSRC is the directory of the Varnish source tree for which to
compile your vmod. Both the VARNISHSRC and VARNISHSRC/include
will be added to the include search paths for your module.

Make targets:
    make - builds the vmod
    make install - installs your vmod in VMODDIR
    make check - runs the unit tests in src/tests/*.vtc

In your VCL you could then use this vmod like the following. This
sets the request header X-GeoIP to the requestor's geo (or Unknown).
    ,----
    | import geoip;
    |
    | sub vcl_recv {
    |     set req.http.X-Forwarded-For = client.ip;
    |     set req.http.X-GeoIP = geoip.country(req.http.X-Forwarded-For)
    | }
    `----

HISTORY
=======

Manpage based on the libvmod-example by Varnish Software and tHauke Lampe's
own GeoIP Vmod on https://github.com/lampeh/libvmod-geoip

CREDITS
=======
The idea for this varnish module and the proof of concept and the   
initial implementation are all due to David Newhall II

Lee Doolan, the maintainer, added libtool configuration details,   
added thread safety, added SCM (git). Stability patch provided by Varnish
Software.

COPYRIGHT
=========

This document is licensed under the same license as the
libvmod-example project. See LICENSE for details.

* Copyright (c) 2011 Livejounal
* Copyright (c) 2012 Varnish Software

About

A GeoIp module for varnish

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 72.3%
  • Shell 27.7%