GeoIP and mod_geoip2
I am running Webalizer on my CentOS Linode to view stats for each site I host. I wanted to patch Webalizer with the Geolizer patch so that the location of visitors is more precise.
I found that I would need GeoIP and mod_geoip2 installed first so I found this guide.
How to install GeoIP and mod_geoip2 on centos for apache
1) yum install GeoIP GeoIP-devel GeoIP-data zlib-devel
2) mkdir /usr/local/share/GeoIP
3) Download the latest Country and City database files from maxmind
wget (link to) /GeoIP.dat.gz
wget (link to) /GeoLiteCity.dat.gz
4) yum install httpd-devel apr-devel
5) wget (link to) /mod_geoip2_1.2.5.tar.gz
6) tar xvzf mod_geoip2_1.2.5.tar.gz && cd mod_geoip2_1.2.5
7) apxs -i -a -L/usr/lib64 -I/usr/include -lGeoIP -c mod_geoip.c
8) Enabling mod-geoip
Nothing’s going to work unless mod-geoip is enabled in your apache configuration. You’ll need the following lines in your httpd.conf file (located on CentOS systems at /etc/httpd/conf/httpd.conf)
GeoIPDBFile /usr/local/share/GeoIP/GeoIP.dat Standard
GeoIPDBFile /usr/local/share/GeoIP/GeoLiteCity.dat Standard
9) Restart Apache so your changes will take effect by entering the following command.
I followed it step by step but I am getting the following output at step 7:
/usr/lib/apr-1/build/libtool –silent –mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fno-strict-aliasing -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd -I/usr/include/apr-1 -I/usr/include/apr-1 -I/usr/include -c -o mod_geoip.lo mod_geoip.c && touch mod_geoip.slo
mod_geoip.c: In function ‘geoip_header_parser’:
mod_geoip.c:328: warning: implicit declaration of function ‘ap_add_common_vars’
mod_geoip.c:423: error: ‘GEOIP_NETSPEED_EDITION_REV1′ undeclared (first use in this function)
mod_geoip.c:423: error: (Each undeclared identifier is reported only once
mod_geoip.c:423: error: for each function it appears in.)
mod_geoip.c:458: warning: implicit declaration of function ‘GeoIP_country_id_by_addr_v6′
mod_geoip.c:546: error: ‘GEOIP_CITY_EDITION_REV0_V6′ undeclared (first use in this function)
mod_geoip.c:547: error: ‘GEOIP_CITY_EDITION_REV1_V6′ undeclared (first use in this function)
mod_geoip.c:303: warning: unused variable ‘gip’
apxs:Error: Command failed with rc=65536
To be honest I don't even know what the step 7 command does (stupid I know :( )
Does anyone have any info on what this does and also where I am going wrong?
Do you know if you are on 32-bit vs 64-bit?
Your apxs command is compiling against 64-bit libraries (or trying to, based upon the -L/usr/lib64 argument).
Hi, thanks for the reply. It is a 32 bit distribution.
I had wondered about that line :(