Eu sinto sua dor, como desenvolvedor web eu tenho mais de 200 vhosts no meu desenvolvedor local - eu pessoalmente não me importo com os logs & registre todos eles no diretório principal / var / log / apache ...
No entanto, o que eu fiz foi escrever um script de shell para adicionar / gerenciar todos os meus vhosts - tudo que você precisa fazer é ajustá-lo para gravar os logs onde quiser ...
#!/bin/bash
ARGS=1
if [ "$1"X = "X" ];
then
echo "Must enter domain name"
exit 0
fi
if [ "$2"X = "X" ];
then
echo "Must enter domain suffix"
exit 0
fi
if [ "$3"X = "X" ];
then
echo "you must type "restart" if you want apache restarted "no" if not!"
exit 0
fi
domain=$1.$2;
#echo $domain;
#exit 0
rm $domain.conf
echo "<VirtualHost *:80>" >> $domain.conf;
echo " ServerAdmin [email protected]" >> $domain.conf;
echo " ServerName $1.network.local" >> $domain.conf;
echo " DocumentRoot /Data/vhome/$1.$2/httpdocs" >> $domain.conf;
echo " HostnameLookups Off" >> $domain.conf;
echo " UseCanonicalName Off" >> $domain.conf;
echo " ServerSignature On" >> $domain.conf;
echo " ScriptAlias /cgi-bin/ "/Data/vhome/$1.$2/cgi-bin/"" >> $domain.conf;
echo " ErrorLog /var/log/apache2/error_log" >> $domain.conf;
echo " CustomLog /var/log/apache2/access_log combined" >> $domain.conf;
echo " <Directory "/Data/vhome/$1.$2/cgi-bin">" >> $domain.conf;
echo " AllowOverride All" >> $domain.conf;
echo " Options +ExecCGI -Includes" >> $domain.conf;
echo " Order allow,deny" >> $domain.conf;
echo " Allow from all" >> $domain.conf;
echo " </Directory>" >> $domain.conf;
echo " <Directory "/Data/vhome/$1.$2/httpdocs">" >> $domain.conf;
echo " Options Indexes FollowSymLinks" >> $domain.conf;
echo " AllowOverride All" >> $domain.conf;
echo " Order allow,deny" >> $domain.conf;
echo " Allow from all" >> $domain.conf;
echo " </Directory>" >> $domain.conf;
echo " # #XSS prevention" >> $domain.conf;
echo " # RewriteEngine On" >> $domain.conf;
echo " # RewriteCond %(REQUEST_METHOD) ^TRACE" >> $domain.conf;
echo " # RewriteRule .* -[F]" >> $domain.conf;
echo "</VirtualHost>" >> $domain.conf;
if [ "$3" = "restart" ];
then
rcapache2 restart;
fi
chmod 666 $domain.conf
cat $domain.conf
echo "Created!";
exit 0
Espero que ajude.
-sean