This is version . It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]
  1. !/bin/bash

if "$#" -lt 3 ; then echo "" echo "Usage : addvirtual dominio utente database" echo "" exit 0 fi

if -f /etc/apache2/conf.d/vhost.d/www.$1.conf (info) ; then echo "" echo "Il virtual server esiste gia'" echo "" exit 0 fi

if -d /home/www/www.$1 (info) ; then echo "" echo "La directory sotto /home/www esiste gia'" echo "" exit 0 fi

if ! -f /opt/template/virtual.conf (info) ; then echo "" echo "Il file /opt/template/virtual.conf non esiste" echo "" exit 0 fi

if -f /etc/apache2/conf.d/vhost.xml/$1.xml (info) ; then echo "" echo "Il file /etc/apache2/conf.d/vhost.xml/$1.xml esiste gia'" echo "" exit 0 fi

if ! -f /opt/template/template.xml (info) ; then echo "" echo "Il file /opt/template/template.xml non esiste" echo "" exit 0 fi

  1. Controllo se l'utente esiste
cat /etc/passwd | grep $2 > /dev/null && echo "L'utente esiste gia'" && exit 0
  1. Crea il file di configurazione per http
sed -e s/LLLL/$1/g /opt/template/virtual.conf > /etc/apache2/conf.d/vhost.d/www.$1.conf
  1. Crea il file di configurazione per xml
sed -e s/LLLL/$1/g /opt/template/template.xml | sed -e s/DDDD/$3/g - > /etc/apache2/conf.d/vhost.xml/$1.xml
  1. Crea le directory di lavoro
cp -a /home/www/skel /home/www/www.$1
  1. Crea il file di configurazione per Webalizer
sed -e s/LLLL/$1/g /opt/template/webalizer.conf > /home/www/www.$1/logs/webalizer.$1.conf

Add new attachment

Only authorized users are allowed to upload new attachments.
« This particular version was published on 14-Apr-2010 14:30 by RaffaelePedrini.