diff options
Diffstat (limited to 'sca-cpp/trunk/modules')
-rwxr-xr-x | sca-cpp/trunk/modules/http/vhost-conf | 14 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/http/vhost-ssl-conf | 13 |
2 files changed, 17 insertions, 10 deletions
diff --git a/sca-cpp/trunk/modules/http/vhost-conf b/sca-cpp/trunk/modules/http/vhost-conf index f45d448906..a36b195844 100755 --- a/sca-cpp/trunk/modules/http/vhost-conf +++ b/sca-cpp/trunk/modules/http/vhost-conf @@ -22,6 +22,9 @@ here=`readlink -f $0`; here=`dirname $here` mkdir -p $1 root=`readlink -f $1` +vroot=`readlink -f $2` +vhtdocs=$3 + conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` host=`echo $conf | awk '{ print $6 }'` addr=`echo $conf | awk '{ print $7 }'` @@ -41,24 +44,17 @@ NameVirtualHost $vhost <VirtualHost $vhost> ServerName http://vhost.$host:$pport ServerAlias *.$host -VirtualDocumentRoot $htdocs/domains/%1/ +VirtualDocumentRoot $vroot/%1/$vhtdocs/ Include conf/dvhost.conf # Allow access to document root -<Directory "$htdocs"> +<Directory "$vroot"> Options FollowSymLinks AuthType None Require all granted </Directory> -# Allow access to root location -<Location /> -Options FollowSymLinks -AuthType None -Require all granted -</Location> - </VirtualHost> EOF diff --git a/sca-cpp/trunk/modules/http/vhost-ssl-conf b/sca-cpp/trunk/modules/http/vhost-ssl-conf index 36b2a15412..314773a338 100755 --- a/sca-cpp/trunk/modules/http/vhost-ssl-conf +++ b/sca-cpp/trunk/modules/http/vhost-ssl-conf @@ -31,6 +31,10 @@ sslport=`$here/httpd-addr port $ssladdr` sslpport=`$here/httpd-addr pport $ssladdr` sslvhost=`$here/httpd-addr vhost $ssladdr` +vhostconf=`cat $root/conf/httpd.conf | grep "# Generated by: vhost-conf"` +vroot=`echo $vhostconf | awk '{ print $6 }'`; vroot=`readlink -f $vroot` +vhtdocs=`echo $vhostconf | awk '{ print $7 }'` + htdocs=`echo $conf | awk '{ print $8 }'` mkdir -p $htdocs htdocs=`readlink -f $htdocs` @@ -45,9 +49,16 @@ NameVirtualHost $sslvhost <VirtualHost $sslvhost> ServerName https://vhost.$host:$sslpport ServerAlias *.$host -VirtualDocumentRoot $htdocs/domains/%1/ +VirtualDocumentRoot $vroot/%1/$vhtdocs/ Include conf/dvhost-ssl.conf +# Allow access to document root +<Directory "$vroot"> +Options FollowSymLinks +AuthType None +Require all granted +</Directory> + </VirtualHost> |