summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/http
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/modules/http')
-rwxr-xr-xsca-cpp/trunk/modules/http/httpd-conf12
-rwxr-xr-xsca-cpp/trunk/modules/http/httpd-ssl-conf13
2 files changed, 19 insertions, 6 deletions
diff --git a/sca-cpp/trunk/modules/http/httpd-conf b/sca-cpp/trunk/modules/http/httpd-conf
index 35c6c78254..b281874d92 100755
--- a/sca-cpp/trunk/modules/http/httpd-conf
+++ b/sca-cpp/trunk/modules/http/httpd-conf
@@ -21,7 +21,11 @@
here=`readlink -f $0`; here=`dirname $here`
root=`readlink -f $1`
host=$2
-port=$3
+port=`echo $3 | awk -F "/" '{ print $1 }'`
+pport=`echo $3 | awk -F "/" '{ print $2 }'`
+if [ "$pport" = "" ]; then
+ pport=$port
+fi
htdocs=`readlink -f $4`
user=`id -un`
group=`id -gn`
@@ -34,7 +38,9 @@ cat >$root/conf/httpd.conf <<EOF
# Apache HTTPD server configuration
# Set server name
-ServerName $host
+ServerName $host:$pport
+UseCanonicalName On
+UseCanonicalPhysicalPort off
PidFile $root/logs/httpd.pid
# Minimal set of modules
@@ -114,7 +120,7 @@ Allow from all
# Setup HTTP virtual host
Listen $port
<VirtualHost _default_:$port>
-
+ServerName $host:$pport
</VirtualHost>
EOF
diff --git a/sca-cpp/trunk/modules/http/httpd-ssl-conf b/sca-cpp/trunk/modules/http/httpd-ssl-conf
index 6f763c6a66..16b2322809 100755
--- a/sca-cpp/trunk/modules/http/httpd-ssl-conf
+++ b/sca-cpp/trunk/modules/http/httpd-ssl-conf
@@ -21,7 +21,11 @@
here=`readlink -f $0`; here=`dirname $here`
root=`readlink -f $1`
host=$2
-sslport=$3
+sslport=`echo $3 | awk -F "/" '{ print $1 }'`
+sslpport=`echo $3 | awk -F "/" '{ print $2 }'`
+if [ "$sslpport" = "" ]; then
+ sslpport=$sslport
+fi
htdocs=`readlink -f $4`
httpd_prefix=`cat $here/httpd.prefix`
@@ -33,8 +37,8 @@ cat >>$root/conf/httpd.conf <<EOF
# Redirect all HTTP traffic to HTTPS
<Location />
RewriteEngine on
-RewriteCond %{SERVER_PORT} !^$sslport$
-RewriteRule .* https://%{SERVER_NAME}:$sslport%{REQUEST_URI} [R,L]
+RewriteCond %{SERVER_PORT} !^$sslpport$
+RewriteRule .* https://%{SERVER_NAME}:$sslpport%{REQUEST_URI} [R,L]
</Location>
# Setup SSL support
@@ -50,6 +54,9 @@ SSLRandomSeed connect builtin
# HTTPS virtual host
Listen $sslport
<VirtualHost _default_:$sslport>
+ServerName $host:$sslpport
+UseCanonicalName On
+UseCanonicalPhysicalPort off
# Enable SSL
SSLEngine on