Bandwidth Usage Graphing (Part 2) – Webalizer

The next part in setting up bandwidth graphing is to setup Webalizer. Webalizer needstobe downloaded and installed on your server.  This can be done in a few different ways including downloading the file from Webalizer.com.  The other option if your running a linux server is to use the command “yum install Webalizer” within the SSH screen.  Once you have Webalizer installed you must navigate to the configuration file which on CentOS5 is located in”/etc/webalizer.conf”.  This configuration file will allow you to setup Webalizer so that it knows where your log files are located and many other options that I am not going to go into.

Near the top of the configuration file is the first option that must be set.  This is the log file location.  The syntex is going to be “LogFile   /the/path/to/your/log/file”.  The next option that you will want to setup is the output directory for your stats pages.  These pages are generated by Webalizer each time it runs and can give you a lot of information about the traffic that is visiting your sites.  The syntex for the output directory is “OutputDir     /the/path”

Now you want to scroll through the file until you find the Dump Path.  The dump path is where you want to dump the stats file that we will use for generating the bandwidth graph.  This file is going to be in CSV format which will allow us to use an automated script to import it into a MySQL database.  Along with the Dump Path there are a few other options that follow that need to be changed.  First verify that the Dump Extension is csv, if not change this.  Following that is the invidual tables that should be created(dumped).  The only table that is needed is the sites so you can put “yes” without the quotation marks next to the DumpSites.  All the other tables should have a “no” following them.

Once you have made the above changes to the Webalizer configuration file, it is time to save the file and move on to importing the csv file automatically into the MySQL database.

This entry was posted in Entrepreneurial, Programming and tagged , , , , . Bookmark the permalink.