How To Install Webalizer On CentOS

by admin on November 23, 2010

The Webalizer is a fast, free web server log file analysis program. It produces highly detailed, easily configurable usage reports in HTML format, for viewing with a standard web browser, in this article webalizer installed in Centos 5.4.
1. Download Webalizer

[[email protected] src]# wget

2. Installing packages

[[email protected] src]# yum -y install gcc gcc-c++ gd-devel

3. Compile GeoIP

[[email protected] src]# wget
[[email protected] src]# tar zxvf GeoIP.tar.gz
[[email protected] src]# ./configure

[[email protected] src]# make && make install

Move GeoIP library

[[email protected] src]# cp /usr/local/lib/libGeoIP* /lib

4. Tarball package webalizer

[[email protected] src]# tar zxvf webalizer-2.20-01-src.tgz

3. Download GeoIP Database

[[email protected] src]# wget
[[email protected] src]# gunzip GeoIP.dat.gz
[[email protected] src]# mv ./GeoIP.dat /usr/local/share/GeoIP/GeoIP.dat

5. Compile webalizer

[[email protected] src]# cd webalizer-2.20-01

[[email protected] webalizer-2.20-01]# ./configure --prefix=/usr/local/webalizer --sysconfdir=/usr/local/etc/webalizer --enable-geoip

[[email protected] webalizer-2.20-01]# make

[[email protected] webalizer-2.20-01]# make install

6. Create directory for configuration webalizer

[[email protected] webalizer-2.20-01]# mkdir /usr/local/etc/webalizer

7. Use default configuration and copying to your configuration

[[email protected] webalizer-2.20-01]# cp /usr/local/etc/webalizer/webalizer.conf.sample  /usr/local/etc/webalizer/

8. Create directory same with your document root

[[email protected] webalizer-2.20-01]# mkdir /var/www/

9. Edit this file

[[email protected] webalizer-2.20-01]# vi /usr/local/etc/webalizer/

And find and changes the content

LogFile /var/log/httpd/access_log


LogFile /var/log/httpd/


OutputDir /var/www/usage/


OutputDir  /var/www/

And find:

HostName       localhost


HostName  # it depend on your web hostname


#GeoIP           	yes

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


GeoIP           	yes

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

10. Test your configuration with this syntax

[[email protected] webalizer-2.20-01]# for i in /usr/local/etc/webalizer/*.conf; do webalizer -c $i; done

11. Using this syntax for using crontab.

[[email protected] webalizer-2.20-01]# vi /root/dowebalizer

Add Code:


use strict;

my @files = </usr/local/etc/webalizer/*.conf>;

foreach my $file (@files) {


system("/usr/local/bin/webalizer -c $file");


12. Using crontab for automatically updated

[[email protected] webalizer-2.20-01]# crontab -e

Add Code:

1 * * * * /root/dowebalizer >>/dev/null 2>&1

Related Posts:

{ 1 comment… read it below or add one }

Paul October 11, 2013 at 8:04 am

I have tested for “for i in /usr/local/etc/webalizer/*.conf; do webalizer -c $i; done” has error like “-bash: webalizer: command not found” .

What should I do?

Thankyou very much


Previous post:

Next post: