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.
# 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