Webstatistics with Webalizer
List | Home
LinuxNetMag #3

Xaudio, xmms, mp3blaster
freeztag, kmp3te
TTY-Quake, Quake3Test
Descent, LDescent, DX1
Wine: Installation and Setup
VCron, Kcrontab
Passwords with Gpasman
Bootlogos: Welcome2L...
[email protected] and tools


Alternative Web-Browser
VNC - Windows X-Server
Fetchmail Part II
Apache the webserver
Windows networks: Samba
Webpublishing: Sitecopy
downloadhelp Wget
recommended links


HD-/Floppy- Access


Complete list of articles



Bar diagram
Who used my web server? When, How often? Which sites are high frequency and what is the trend of the daily visitor counter?

If you asked yourself these questions or if you are just curious about how your web server is used then webalizer is the right program for you.
Webalizer not just counts the visitors of one web site, but produces statistics of your entire web server.

The Way It Works

Apache adds an entry for every viewing of a site or file of your web server into the file /var/log/httpd.access_log. This entry includes a lot of information about the visitor who visited the site. Webalizer uses the saved data and generates tables and plots which show the access to the server for every month and day using bar diagrams. In addition, the most frequented web sites are listed.

Webalizer reportsThe data and plots are included in an HTML page that can be published on the server, too.


The configuration is not very complicated with SuSE distributions because the program exists as a pre-compiled version that was adjusted to SuSE.

Also, RedHat and Slackware special versions are accessible at the homepage of webalizer.

The configuration of webalizer happens in the file /etc/webalizer.conf . After the entry "OutputDir", you specify the path where the HTML page with the statistics will be saved. If you wanted to publish the sites in real time you should instead save the page in the web server directory. With SuSE 6.x this is a subdirectory in /usr/local/httpd/htdocs/ .

It is recommended to add a user who is just responsible for the web server (use YAST to create a user) e.g. with the name "wwwadmin". This user should create the subdirectory so he has permissions to write into it later. In addition, he needs the permissions to read the file /etc/webalizer.conf and /var/log/httpd.access_log (The permissions to read the files can be changed with chmod +r filename).

First you change to the user "wwwadmin" with

>> su wwwadmin

and then, after entering the password, you create the subdirectory with

>> mkdir /usr/local/httpd/htdocs/webalizer

(If you do not want to add a new user this can be done by root, too.)
Then you change the corresponding part in the file /etc/webalizer

File /etc/webalizer.conf
 # OutputDir is where you want to put the output files.  This should 
# should be a full path name, however relative ones might work as well.
# If no output directory is specified, the current directory will be used.  OutputDir      /usr/local/httpd/htdocs/webalizer

In addition, in this file you can set the appearance of the generated pages. The options are well documented. The default settings make sense and changes are not really necessary.

After the first start of webalizer

>> webalizer

the pages are generated and put in the specified directory. You can have a look at them at http://localhost/webalizer.


For up-to-date data, webalizer has to be run regularly. Depending on the load of your server and the wish for real-time information, a refresh of every 24 hours down to 5 minutes make sense.

Cron is the best choice to realize this. So  we let the user who has the permissions to write into /usr/local/httpd/htdocs/webalizer and the right to read the files /var/log/httpd.access_log and /etc/webconf.conf execute the command "/usr/bin/webalizer".
The configuration of cron can be done with

>>crontab -e

or using graphical front-ends like "vcron" or "kcron" (also have a look at "Just on time: Vcron, Kcrontab")

Kcrontab Screenshot

With this configuration, you always get informed about your web statistics.


Other issues of Linux NetMag
[ #1 | #2 | #3 | Main ]