Fixed a bug in CentOS 4 with BlueQuartz

Support for webhosts that use CentOS
Post Reply
mythnetworks
Posts: 2
Joined: 2005/10/09 01:52:55
Contact:

Fixed a bug in CentOS 4 with BlueQuartz

Post by mythnetworks » 2005/10/09 04:21:23

[b][color=009900]MythNetworks, http://www.mythnetworks.com, has crafted a fix to webalizer in BlueQuartz on CentOS allowing it to work seamlessly on all of the vsites![/color][/b]

[color=0066FF]We will very soon begin to release these wonderful Cobalt RaQ alternative appliances as a supported offering... Stay Tuned... The proposed name is to be "BlueDiamond" [/color]

Hi All,

I finally got my CentOS 4 / BlueQuartz installation exactly where I needed it!

The final peice was an addition that fixes the included webalizer to make it work on all of the vsites. It is a simple bash shell script and crontab entry... So far, it works well and places the output exactly where BlueQuartz expects to see it.

Kudos to CentOS for an AMAZING DISTRO!!! Love it!

Code Below:

#!/bin/bash

###########################################################
# This script will break out the webalizer stats for each #
# individual vsite on a BlueQuartz Installation. #
# #
# Built by Lee Markham - Myth Networks (Its no Myth! ) #
# http://www.mythnetworks.com #
###########################################################
# PREREQ: Requires Webalizer installed from RPM or PKG!!! #
# rpm -qa | grep webalizer #
# Should say: webalizer-2.01_10-25BQ2 #
###########################################################
# INSTRUCTIONS: #
# 1. Place into /usr/local/bin/webalizervsite #
# 2. Chmod to 700 or 755 (Executable by Root) #
# 3. Install into cron to run as needed #
# DONE!!! - Data will be in /webalizer directory... #
###########################################################
#
# Stuff to do: (The Laundry List)
# 1. copy the logs to a new file (/home/log.now)
cp /var/log/httpd/access_log /home/log.now
# 2. look into the homesite dir and get the names
# of all of the vsites. (ls /home/sites)
export LIST=`ls /home/sites`
echo "FOUND LIST OF: "
echo "$LIST"
for vsite in $LIST
do
############################################################
# 3. Cat the log and grep for the vsite, redirect to
# (/home/sites/$sitename/logs/log.now)
############################################################
echo "MOVING $vsite"
cat /home/log.now | grep -i $vsite > /home/sites/$vsite/logs/log.now
echo "DONE. "
############################################################
# 4. Run webalizer against that log using the command
############################################################
echo "Runing webalizer for $vsite"
mkdir -p /home/sites/$vsite/web/webalizer
webalizer -p -o /home/sites/$vsite/web/webalizer/ -t $vsite /home/sites/$vsite/logs/log.now
echo "DONE. http://$vsite/webalizer/index.html"
############################################################
# line switches and output to:
# (/home/sites/$sitename/web/webalizer)
# 5. Repeat for each entry.
# 6. Remove the duplicated files.
############################################################
echo "Cleaning Up"
rm /home/sites/$vsite/logs/log.now
echo "COMPLETED OPERATIONS WITH $vsite"
done
rm /home/log.now
echo "DONE WITH EVERYTHING! SUCCESS!"
############################################################
# 7. Thats it! Run it and verify that it will show up
# for a vsite in the usage directory.
#
############################################################
# SAMPLE CRONTAB ENTRY
# As root, run "crontab -e"
# Then enter: "0 * * * * /usr/local/bin/webalizervsite"
############################################################

Post Reply

Return to “CentOS 4 - Webhosting Support”