Script to Manipulate virtual host
The Script was created to create multiple virtual hosts in Apache.
1.txt
lrppiwcwbpb powcwbpb
lrppiwcwbpd powcwbpd
lrppiwcwbpf powcwbpf
lrppiwcwbph powcwbph
sam.conf
DocumentRoot "htdocs/powcwbpb"
ServerName lrppiwcwbpb
ErrorLog "logs/lrppiwcwbpb-error_log"
CustomLog "logs/lrppiwcwbpb-access_log" common
DocumentRoot "htdocs/powcwbpb"
ServerName lrppiwcwbpb
ErrorLog "logs/ssl_lrppiwcwbpb-error_log"
CustomLog "logs/ssl_lrppiwcwbpb-access_log" common
sc.sh
while read line
do
dnsname=`echo $line|cut -d" " -f1`
instance=`echo $line|cut -d" " -f2`
cat sam.conf | sed -e 's/lrppiwcwbpb/'"$dnsname"'/;s/powcwbpb/'"$instance"/'' > conf.d/"$instance".conf
done < 1.txt
No comments:
Post a Comment