Skip to Content
Fedora Linux
book

Fedora Linux

by Chris Tyler
October 2006
Beginner
658 pages
17h 17m
English
O'Reilly Media, Inc.
Content preview from Fedora Linux

Analyzing Web and FTP Logs

Fedora provides the Webalizer tool for analyzing Apache and vsftp logfiles, but the default configuration works only with the default Apache virtual host. With a few minutes of configuration, Webalizer can analyze the logfiles off all of your Apache virtual hosts as well as your vsftp server.

How Do I Do That?

The default configuration for Webalizer analyzes the default Apache logfile at 4:02 a.m. each day, as long as that logfile is not empty. The results can be read by using a browser on the same machine and accessing http://localhost/usage/, which displays the report page. A sample report page is shown in Figure 7-30.

Webalizer web usage report

Figure 7-30. Webalizer web usage report

Analyzing virtual host logfiles

Tip

This configuration assumes that your Apache virtual host logfiles are named /var/log/httpd/<virtualhostname>-<access_log> and are in combined format.

To configure Webalizer to analyze your virtual host logfiles each day, create the file /etc/cron.daily/00webalizer-vhosts:

#! /bin/bash
# update access statistics for virtual hosts

CONF=/etc/httpd/conf/httpd.conf

for NAME in $(sed -n "s=^[^#]*CustomLog logs/\([^ ]*\)-.*=\1=p" $CONF)
do

    mkdir /var/www/usage/$NAME
    chmod a+rx /var/www/usage/$NAME

    LOG=/var/log/httpd/${NAME}-access_log

   if [ -s $NAME ]
   then
     exec /usr/bin/webalizer -Q  -o /var/www/usage/$NAME $LOG
   fi

fi

Make this file readable and executable by root:

# chmod u+rx ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Server Hacks

Linux Server Hacks

Rob Flickenger
Linux Server Hacks, Volume Two

Linux Server Hacks, Volume Two

William von Hagen, Brian K. Jones

Publisher Resources

ISBN: 0596526822Errata Page