I call this "Grab That Apache" or GTA.

I wanted to 'walk' all non-default apache installs on my CentOS|Ubuntu hosts and tar up the appropriate directory...
Since we only have two OSs to be concerned with, I wanted a generic script and here's what I made...
Code:
#!/bin/bash
### Author: JJ of cirrhus9.com
### Purpose: Get non-default Apache installs and tar them up by Name
### Date: 05-07-2012
### Modified: 1336407790
### OS Check
grep -iq "CentOS" /proc/version
if [ $? = '0' ];then
OS="CentOS"
cd /c9backups
echo \#\!/bin/bash > gta.sh
chmod 700 gta.sh
TARDATE=$(date '+%m-%d-%Y.%s')
APACHEPROGBASE=$(grep -h "Alias /" /etc/httpd/conf.d /etc/httpd/conf/ -R | egrep -v "home|ScriptAlias|#|doc|error|icons|javascript" | awk '{print $1 " "$2 " "$3}' | sed -e 's/Alias \///g' | sed -e 's/"//g')
echo "$APACHEPROGBASE" | while read col1 col2 ; do echo "/bin/tar -pzcf" "$col1"_"$TARDATE".tar.gz "$col2" ;done >> gta.sh
/c9backups/gta.sh
else
OS="Ubuntu"
cd /c9backups
echo \#\!/bin/bash > gta.sh
chmod 700 gta.sh
TARDATE=$(date '+%m-%d-%Y.%s')
APACHEPROGBASE=$(grep -h "Alias /" /etc/apache2/*.conf /etc/apache2/conf.d/*.conf -R | egrep -v "home|ScriptAlias|#|doc|error|icons|javascript" | awk '{print $1 " "$2 " "$3}' | sed -e 's/Alias \///g' | sed -e 's/"//g')
echo "$APACHEPROGBASE" | while read col1 col2 ; do echo "/bin/tar -pzcf" "$col1"_"$TARDATE".tar.gz "$col2" ;done >> gta.sh
/c9backups/gta.sh
fi
It still needs error handling, a reporting feature, and a rotation of the number of copies to keep, But it works as is.
Enjoy.