You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2010/10/28 09:29:11 UTC

svn commit: r1028209 - in /tuscany/sca-cpp/trunk/modules/http: httpd-conf httpd-ssl-conf

Author: jsdelfino
Date: Thu Oct 28 07:29:11 2010
New Revision: 1028209

URL: http://svn.apache.org/viewvc?rev=1028209&view=rev
Log:
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.

Modified:
    tuscany/sca-cpp/trunk/modules/http/httpd-conf
    tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf

Modified: tuscany/sca-cpp/trunk/modules/http/httpd-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd-conf?rev=1028209&r1=1028208&r2=1028209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd-conf Thu Oct 28 07:29:11 2010
@@ -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>
 

Modified: tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf?rev=1028209&r1=1028208&r2=1028209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf Thu Oct 28 07:29:11 2010
@@ -44,13 +44,6 @@ org=`openssl x509 -noout -subject -nameo
 # 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 $*