GeoIP for AWStats, installation notes

  1. download GeoIP C API, extract to working dir [/PATH/TO/WORK]
    wget
    tar zxvf
  2. download GeoIP Perl Module (Geo::IP)
    wget
  3. cd /PATH/TO/WORK
    ./configure –prefix=/PATH/TO/GeoIP_C
    make
    make check
    make install
    make clean (optional)
  4. Pay your attention to the message
     

    Libraries have been installed in:
    /PATH/TO/INSTALL/GeoIP/lib

    If you ever happen to want to link against installed libraries
    in a given directory, LIBDIR, you must either use libtool, and
    specify the full pathname of the library, or use the `-LLIBDIR’
    flag during linking and do at least one of the following:
    – add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
    during execution
    – add LIBDIR to the `LD_RUN_PATH’ environment variable
    during linking
    – use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
    – have your system administrator add LIBDIR to `/etc/ld.so.conf’

    See any operating system documentation about shared libraries for
    more information, such as the ld(1) and ld.so(8) manual pages.

  5. Install Geo::IP perl module (faster, but requires C library)
    cd /PATH/TO/GeoIP_PERL
    perl Makefile.PL
    make
    make test
    make install
    make clean (optional)
  6. Extending the perl library path to include your Geo::IP installation
    vim /PATH/TO/AWSTATS/cgi-bin/awstats.pl
    add one line just below “require 5.007;”:
    BEGIN { push @INC, ‘/PATH/TO/INSTALL/GeoIP/lib/perl/5.10.0’ }

歷史上的今天

About mtlin

I'm easygoing and sometimes sentimental, also can be very funny. Geek style but social. A Blogger, a Wikipedian and an Engineer.
This entry was posted in blog, Software and tagged , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.