diff options
Diffstat (limited to 'sca-cpp/trunk/modules/http/vhost-conf')
-rwxr-xr-x | sca-cpp/trunk/modules/http/vhost-conf | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sca-cpp/trunk/modules/http/vhost-conf b/sca-cpp/trunk/modules/http/vhost-conf index 4f563b673e..9dff38d6e7 100755 --- a/sca-cpp/trunk/modules/http/vhost-conf +++ b/sca-cpp/trunk/modules/http/vhost-conf @@ -20,22 +20,23 @@ # Generate mass dynamic virtual hosting configuration here=`readlink -f $0`; here=`dirname $here` root=`readlink -f $1` + conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` host=`echo $conf | awk '{ print $6 }'` -port=`echo $conf | awk '{ print $7 }' | awk -F "/" '{ print $1 }'` -pport=`echo $conf | awk '{ print $7 }' | awk -F "/" '{ print $2 }'` -if [ "$pport" = "" ]; then - pport=$port -fi +addr=`echo $conf | awk '{ print $7 }'` +port=`$here/httpd-addr port $addr` +pport=`$here/httpd-addr pport $addr` +vhost=`$here/httpd-addr vhost $addr` + htdocs=`echo $conf | awk '{ print $8 }'` htdocs=`readlink -f $htdocs` cat >>$root/conf/httpd.conf <<EOF # Generated by: vhost-conf $* # Enable mass dynamic virtual hosting -NameVirtualHost *:$port +NameVirtualHost $vhost -<VirtualHost *:$port> +<VirtualHost $vhost> ServerName http://vhost.$host:$pport ServerAlias *.$host VirtualDocumentRoot $htdocs/domains/%1/ |