Tim's Web Site 2.0

About Me

Miscellaneous

Geek Stuff

Skydiving


My Amazon.com Wish List

Geek Stuff : Tutorials : Archive : Webalizer How-To

Webalizer Installation on Slackware Linux

Since most web geeks wanna know how many people are visiting their site, how many page views they're getting, what browsers are most used, what pages are the most popular, what countries their web visitors come from, etc.. they need some kind of web analizing program on their server to make this information in their logs a little more human-friendly.

If you too are one of these anal-retentive type web geeks, like myself, you will want to install Webalizer on your web server so you too can see this stuff. Follow the tutorial below and you should have Webalizer up and running on your server shortly..

Note: This page hasn't been updated since the middle of 2002, and it won't be updated again. It may still be somewhat useful though, but you'll need to download the various software packages from their respective sites since I no longer host them here. I haven't altered the "wget" lines below since this is an archive page, but if you copy and paste them they will return a "file not found" error..

I also no longer respond to questions on this tutorial, so please don't send any.

Download The Files

You will first need to download the files you'll need. If you're not on as root now, su and get on as the root user. When I did this I changed into my source code directory with the following command:

cd /usr/src

Then fetch the necessarry files you'll need using the 'wget' command on each, one at a time, as follows:

wget http://www.rocketry.org/~tim/downloads/gd-1.8.4.tar.gz

wget http://www.rocketry.org/~tim/downloads/jpegsrc.v6b.tar.gz

wget http://www.rocketry.org/~tim/downloads/libpng-1.0.12.tar.gz

wget http://www.rocketry.org/~tim/downloads/zlib-1.1.3.tar.gz

wget http://www.rocketry.org/~tim/downloads/freetype-2.0.5.tar.gz

wget http://www.rocketry.org/~tim/downloads/webalizer-2.01-09-src.tgz

Unzip and Inflate Files

Next you'll need to unzip and unarchive the files. You will do this by executing the following commands, one at a time:

tar -zxvf gd-1.8.4.tar.gz

tar -zxvf jpegsrc.v6b.tar.gz

tar -zxvf libpng-1.0.12.tar.gz

tar -zxvf zlib-1.1.3.tar.gz

tar -zxvf freetype-2.0.5.tar.gz

tar -zxvf webalizer-2.01-09-src.tgz

The files should expand into their own directories. You will then want to make some soft links with friendlier names for each using the following commands:

ln -s gd-1.8.4 gd

ln -s jpeg-6b jpeg

ln -s libpng-1.0.12 libpng

ln -s zlib-1.1.3 zlib

ln -s freetype-2.0.5 freetype

ln -s webalizer-2.01-09 webalizer

Install jpeg

You should already be in the /usr/src directory. To install the jpeg library you will need to change into that directory with the following command:

cd jpeg

You will now configure and compile the jpeg library using the following commands, one at a time:

./configure

make

make install

Install zlib

Next you will need to install the zlib library. Change into the zlib directory with the following command:

cd ../zlib

You will now configure and compile the zlib library using the following commands, one at a time:

./configure

make

make test

make install

Install libpng

Now you'll need to install the libpng stuff. This is needed to render the cool dynamically generated bar graphs and pie charts. Change into the directory with the following command:

cd ../libpng

Since there are Makefiles for other operating systems in the package we will need to use the one built for Linux systems. Copy the needed Makefile into the current directory with this command:

cp scripts/makefile.linux makefile

Now you can compile libpng with the following commands, one at a time:

make

make test

make install

Install freetype

Next you'll need to get into the FreeType directory. Do so with the following command:

cd ../freetype

Now you will compile FreeType with the following commands, one at a time:

make setup

make

make install

Install gd

The gd library helps with the dynamic graphics creation too. Change into that directory with this command:

cd ../gd

Compilation of this library is simple by using the following command:

make

Install Webalizer

Finally we will install the Webalizer software. First change into the webalizer directory with this command:

cd ../webalizer

Now you will compile the Webalizer software with the following two commands, one at a time:

make

make install

Configuring Apache

The Webalizer software expects the logs to be in a certain format. You will need to use the 'CustomLog' directive for this to happen. On my server I have virtual domains running, and the domain stuff (at the bottom of my /usr/local/apache/conf/httpd.conf file, your httpd.conf file's location might be different) looks like this:

<VirtualHost 68.14.228.126>
ServerAdmin webmaster@rocketry.org
DocumentRoot /usr/local/apache/htdocs
ServerName www.rocketry.org
ServerAlias rocketry.org
ScriptAlias /cgi-bin/ /usr/local/apache/cgi-bin/
ErrorLog /var/log/DOMAIN_WEB_LOGS/rocketry.org/error_log
CustomLog /var/log/DOMAIN_WEB_LOGS/rocketry.org/access_log combined
<VirtualHost>

Configuring Webalizer

Finally, you will need to configure Webalizer. Change directories into the /etc directory to start using this command:

cd /etc

Then copy the example Webalizer configuration file to the normal name using this command:

cp webalizer.conf.sample webalizer.conf

You may open the /etc/webalizer.conf file using whatever text editor you like. vi or pico will do, I usually use pico editor since it's pretty easy to use:

pico -w webalizer.conf

There are many options, and I might cover some of them in the future. But for now the comments in the file should help you along just fine.

Note: The /etc/webalizer.conf file has a line in there for the 'OutputDir', you will need to create the directory for this in your web site's document root.

Setting Up Crontab To Run Webalizer Automatically

Once you get the configuration file configured the way you want it you will want to set your server up to automatically execute the Webalizer program on regular intervals. I set mine up to run it once every hour using crontab. You can do this to by running this comand to start:

crontab -e

The crontab program uses the vi editor, so you will need to hit 'a' to append the following stuff to the file. After you hit 'a', paste the following into the file:

0 * * * * /usr/local/bin/webalizer 1> /dev/null 2> /dev/null

Note: The /dev/null stuff shown is there to prevent the contab daemon from spamming you via email every hour letting you know that it ran.

Save the file (first hit [esc], then [shift]-ZZ) and voila, it it will automatically run Webalizer once per hour so you can check out the nifty bar and pie charts with up to the hour stats whenever you desire. =)

©1995 - 2008 Tim Patterson, All Rights Reserved (Unless otherwise noted)