summaryrefslogtreecommitdiffstats
path: root/sca-cpp
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
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')
-rwxr-xr-xsca-cpp/trunk/modules/http/httpd-conf4
-rwxr-xr-xsca-cpp/trunk/modules/http/httpd-ssl-conf32
2 files changed, 29 insertions, 7 deletions
diff --git a/sca-cpp/trunk/modules/http/httpd-conf b/sca-cpp/trunk/modules/http/httpd-conf
index 61996928b3..8a6928d823 100755
--- a/sca-cpp/trunk/modules/http/httpd-conf
+++ b/sca-cpp/trunk/modules/http/httpd-conf
@@ -143,6 +143,10 @@ Listen $listen
<VirtualHost $vhost>
ServerName http://$host:$pport
+RewriteEngine on
+RewriteCond %{HTTP_HOST} !^$host [NC]
+RewriteRule .* http://$host:$pport%{REQUEST_URI} [R,L]
+
Include conf/svhost.conf
</VirtualHost>
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 $*