Virtual hosts are used to run more than one web site on a single machine.
Virtual hosts can be “IP-based”, meaning that you have a different IP address for every web site, or “name-based”, meaning that you have multiple names running on each IP address.
I want to show you one of mine scripts for easy create virtual hosts in Debian Squeeze or ubuntu.
# Check if is root
if [ “$UID” -ne “$ROOT_UID” ]
echo “You must be root to run this script.”
if [ -n “$1” ]
echo “You must provide a full domain name for this site, i.e. ‘example.com’ ”
echo -n “Run this script like ./script example.com .”
#Create document root site folder
mkdir -p $WWW_ROOT/$DOMAIN