Setting up webalizer in centos 6

I am building this from source.  I realize the package comes with cent but I want to keep it up to date.  If you build your own from source make sure yum doesn’t stomp on it.

Packages needed

gcc, gcc-c++, gd-devel

Download

webalizer source from http://www.webalizer.org

GeoIP source from http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz

Compile

tar zxvf GeoIP.tar.gz

cd into the directory created

./configure

make && make install

tar zxvf webalizer.tar.gz file

cd into directory created

./configure –prefix=/usr/local/webalizer –sysconfdir=/usr/local/etc/webalizer –enable-geoip

make && make install

Setup ld properly

This step prevents this error “error while loading shared libraries: libGeoIP.so.1: cannot open shared object file: No such file or directory” when running webalizer.

cd /etc/ld.so.conf.d

vi geoip.conf  (This can be named anything.conf)

add “/usr/local/lib” to the file and save it.

Run ldconfig

Update GeoIP database

Download from http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz

gunzip GeoIP.dat.gz

mv GeoIP.dat /usr/local/share/GeoIP/GeoIP.dat

Configure webalizer

cd /usr/local/etc/webalizer

cp webalizer.conf.sample yourdomain.com.conf

vi yourdomain.com.conf and change the following lines

LogFile /var/log/httpd/yourdomain.com-access_log point to your access_log file

OutputDir  /var/www/yourdomain.com/webalizer point to where you want to serve your stats from.  Usually some place under your web root.  You might want to protect it with an htaccess file.

HostName       yourdomain.com

GeoIP yes

GeoIPDatabase /usr/local/share/GeoIP/GeoIP.dat

Run webalizer

/usr/local/webalizer/bin/webalizer -c /usr/local/etc/webalizer/yourdomain.com.conf

If it runs fine add to run in your crontab.