I wanted to add a directory for each domain within this tree like:
Here is the script I wrote to do this:
Next, I created a file that I called webalizer.min
. This file contained the configuration directives that would be common
for all of the domains.
The Readme file in the webalizer directory contains a wealth of
information about each of these options. Basically, the PageType
directives tell webalizer to count hits on files with the .htm, .html,
.cgi, .php,.php3, and .pl extensions as actual 'visits'. The
CountryGraph is useless unless HostNameLookups is on in your Apache
configuration -- it produces a nice pie chart broken down by the country
from which traffic to your site originates. GroupReferrer enables
webalizer to group together the results from major domains. In my case,
I had certain primary search engines for which I thought it would be
instructive to group the results.
Finally, I created a cron script to run webalizer. Script 3
. After running the script
once, I inspected the output to ensure that it was functioning properly
by pointing a browser at http://some_domain/usage/.
I put the script on autopilot by adding a line to my /etc/crontab like
0-59/15 * * * * root /root/webalizer.php > /dev/null
Webalizer is a superior log file analysis tool that is fast and free.
With a little intelligent planning and liberal use of PHP, any ISP can
begin to offer statistics to the owners of each domain that they host.
Rodney Hampton is the founder of
and Associates, an IT
consulting firm in Oak Park, Michigan specializing in open source solutions