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

[root@lifelinux src]# wget

2. Installing packages

[root@lifelinux src]# yum -y install gcc gcc-c++ gd-devel

3. Compile GeoIP

[root@lifelinux src]# wget
[root@lifelinux src]# tar zxvf GeoIP.tar.gz
[root@lifelinux src]# ./configure

[root@lifelinux src]# make && make install

Move GeoIP library

[root@lifelinux src]# cp /usr/local/lib/libGeoIP* /lib

4. Tarball package webalizer

[root@lifelinux src]# tar zxvf webalizer-2.20-01-src.tgz

3. Download GeoIP Database

[root@lifelinux src]# wget
[root@lifelinux src]# gunzip GeoIP.dat.gz
[root@lifelinux src]# mv ./GeoIP.dat /usr/local/share/GeoIP/GeoIP.dat

5. Compile webalizer

[root@lifelinux src]# cd webalizer-2.20-01

[root@lifelinux webalizer-2.20-01]# ./configure --prefix=/usr/local/webalizer --sysconfdir=/usr/local/etc/webalizer --enable-geoip

[root@lifelinux webalizer-2.20-01]# make

[root@lifelinux webalizer-2.20-01]# make install

6. Create directory for configuration webalizer

[root@lifelinux webalizer-2.20-01]# mkdir /usr/local/etc/webalizer

7. Use default configuration and copying to your configuration

[root@lifelinux webalizer-2.20-01]# cp /usr/local/etc/webalizer/webalizer.conf.sample  /usr/local/etc/webalizer/

8. Create directory same with your document root

[root@lifelinux webalizer-2.20-01]# mkdir /var/www/

9. Edit this file

[root@lifelinux 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

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

11. Using this syntax for using crontab.

[root@lifelinux 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

[root@lifelinux 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: