From e378323396c8b9ab2a3b6f4e6fcd788c4440ef6b Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Thu, 28 Oct 2010 07:29:11 +0000 Subject: 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 --- sca-cpp/trunk/modules/http/httpd-conf | 4 ++++ sca-cpp/trunk/modules/http/httpd-ssl-conf | 32 ++++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) (limited to 'sca-cpp') 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 ServerName http://$host:$pport +RewriteEngine on +RewriteCond %{HTTP_HOST} !^$host [NC] +RewriteRule .* http://$host:$pport%{REQUEST_URI} [R,L] + Include conf/svhost.conf 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 < -RewriteEngine on -RewriteCond %{SERVER_PORT} ^$port$ [OR] -RewriteCond %{SERVER_PORT} ^$pport$ -RewriteRule .* https://%{SERVER_NAME}:$sslpport%{REQUEST_URI} [R,L] - # 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 < +RewriteEngine on +RewriteCond %{SERVER_PORT} ^$port$ [OR] +RewriteCond %{SERVER_PORT} ^$pport$ +RewriteRule .* https://$host:$sslpport%{REQUEST_URI} [R,L] + + +EOF + +cat >>$root/conf/dvhost.conf < +RewriteEngine on +RewriteCond %{SERVER_PORT} ^$port$ [OR] +RewriteCond %{SERVER_PORT} ^$pport$ +RewriteRule .* https://%{SERVER_NAME}:$sslpport%{REQUEST_URI} [R,L] + + +EOF + # Generate HTTPS vhost configuration cat >$root/conf/vhost-ssl.conf <