#!/bin/bash
#Add a vhost
#vhost configfile is vhost.conf
echo ""
echo "" >> ./vhost.temp
echo "Options FollowSymLinks" >> ./vhost.temp
echo "AllowOverride All" >> ./vhost.temp
echo "Order allow,deny" >> ./vhost.temp
echo "Allow from all" >> ./vhost.temp
echo "AddDefaultCharset GBK" >> ./vhost.temp
echo "Options +Includes" >> ./vhost.temp
echo "" >> ./vhost.temp
echo "" >> ./vhost.temp
echo "" >> ./vhost.temp
echo "" >> ./vhost.temp
echo "ServerName " >> ./vhost.temp
echo "DocumentRoot " >> ./vhost.temp
echo "DirectoryIndx index.shtml index.html index.php" >> ./vhost.temp
echo "" >> ./vhost.temp
echo ""
echo "Please input Directory ( example \"/var/www/html/\" ):"
read Directory
echo ""
echo "Please input ServerName ( example "" ) :"
read ServerName
sed -e /Directory/{s:Directorypwd:${Directory}:} -e /ServerName/{s/$/$ServerName/} -e /DocumentRoot/{s:$:${Directory}:} vhost.temp >> vhost.conf
rm -f ./vhost.temp
echo ""
echo '###################'
echo '# #'
echo '# "Add vhost OK!" #'
echo '# #'
echo '###################'
echo ""
tail -n 16 vhost.conf
阅读(1223) | 评论(0) | 转发(0) |