summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/http/httpd-ssl-conf
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-10-28 07:29:11 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-10-28 07:29:11 +0000
commite378323396c8b9ab2a3b6f4e6fcd788c4440ef6b (patch)
treeb6baeb151fc36250f36d7d6451f87ffcfcc93f94 /sca-cpp/trunk/modules/http/httpd-ssl-conf
parent1d8cd73b84e0ad2df8ccf1fa2f80c04468f35553 (diff)
Minor improvements to HTTPD configuration scripts. Add a mod-rewrite rule to redirect requests to configured canonical host name. Move HTTPS redirect mod-rewrite rules under the HTTP virtual host configurations.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1028209 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/http/httpd-ssl-conf')
-rwxr-xr-xsca-cpp/trunk/modules/http/httpd-ssl-conf32
1 files changed, 25 insertions, 7 deletions
diff --git a/sca-cpp/trunk/modules/http/httpd-ssl-conf b/sca-cpp/trunk/modules/http/httpd-ssl-conf
index aff1767522..e48902fd82 100755
--- a/sca-cpp/trunk/modules/http/httpd-ssl-conf
+++ b/sca-cpp/trunk/modules/http/httpd-ssl-conf
@@ -44,13 +44,6 @@ org=`openssl x509 -noout -subject -nameopt multiline -in $root/cert/ca.crt | gre
# Generate HTTPD configuration
cat >>$root/conf/httpd.conf <<EOF
# Generated by: httpd-ssl-conf $*
-# Redirect all HTTP traffic to HTTPS
-<Location />
-RewriteEngine on
-RewriteCond %{SERVER_PORT} ^$port$ [OR]
-RewriteCond %{SERVER_PORT} ^$pport$
-RewriteRule .* https://%{SERVER_NAME}:$sslpport%{REQUEST_URI} [R,L]
-</Location>
# Configure SSL support
AddType application/x-x509-ca-cert .crt
@@ -86,6 +79,31 @@ ExtendedStatus On
EOF
+# Generate HTTP vhost configuration
+cat >>$root/conf/svhost.conf <<EOF
+# Generated by: httpd-ssl-conf $*
+# Redirect HTTP traffic to HTTPS
+<Location />
+RewriteEngine on
+RewriteCond %{SERVER_PORT} ^$port$ [OR]
+RewriteCond %{SERVER_PORT} ^$pport$
+RewriteRule .* https://$host:$sslpport%{REQUEST_URI} [R,L]
+</Location>
+
+EOF
+
+cat >>$root/conf/dvhost.conf <<EOF
+# Generated by: httpd-ssl-conf $*
+# Redirect HTTP traffic to HTTPS
+<Location />
+RewriteEngine on
+RewriteCond %{SERVER_PORT} ^$port$ [OR]
+RewriteCond %{SERVER_PORT} ^$pport$
+RewriteRule .* https://%{SERVER_NAME}:$sslpport%{REQUEST_URI} [R,L]
+</Location>
+
+EOF
+
# Generate HTTPS vhost configuration
cat >$root/conf/vhost-ssl.conf <<EOF
# Generated by: httpd-ssl-conf $*