diff options
Diffstat (limited to 'sca-cpp/trunk/modules')
-rwxr-xr-x | sca-cpp/trunk/modules/edit/ssl-start | 8 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/edit/start | 8 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/http/httpd-conf | 14 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/http/httpd-ssl-conf | 17 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/http/httpd.hpp | 8 |
5 files changed, 32 insertions, 23 deletions
diff --git a/sca-cpp/trunk/modules/edit/ssl-start b/sca-cpp/trunk/modules/edit/ssl-start index 919a19f4bb..f467371b80 100755 --- a/sca-cpp/trunk/modules/edit/ssl-start +++ b/sca-cpp/trunk/modules/edit/ssl-start @@ -52,14 +52,6 @@ ErrorDocument 404 /notfound/ ErrorDocument 401 /notauth/ ErrorDocument 500 /oops/ -# Redirect www to main home page -RewriteEngine on -RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC] -RewriteCond %{SERVER_PORT} !^443$ -RewriteRule .* https://sca-store.com:%{SERVER_PORT}%{REQUEST_URI} [L,R] -RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC] -RewriteRule .* https://sca-store.com%{REQUEST_URI} [L,R] - EOF # Configure SCA contributions diff --git a/sca-cpp/trunk/modules/edit/start b/sca-cpp/trunk/modules/edit/start index b2608b245d..dfc6fa2b14 100755 --- a/sca-cpp/trunk/modules/edit/start +++ b/sca-cpp/trunk/modules/edit/start @@ -38,14 +38,6 @@ ErrorDocument 404 /notfound/ ErrorDocument 401 /notauth/ ErrorDocument 500 /oops/ -# Redirect www to main home page -RewriteEngine on -RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC] -RewriteCond %{SERVER_PORT} !^80$ -RewriteRule .* http://sca-store.com:%{SERVER_PORT}%{REQUEST_URI} [L,R] -RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC] -RewriteRule .* http://sca-store.com%{REQUEST_URI} [L,R] - EOF # Configure SCA contributions diff --git a/sca-cpp/trunk/modules/http/httpd-conf b/sca-cpp/trunk/modules/http/httpd-conf index 085e2c6fa3..516debd795 100755 --- a/sca-cpp/trunk/modules/http/httpd-conf +++ b/sca-cpp/trunk/modules/http/httpd-conf @@ -29,6 +29,11 @@ port=`$here/httpd-addr port $3` pport=`$here/httpd-addr pport $3` listen=`$here/httpd-addr listen $3` vhost=`$here/httpd-addr vhost $3` +if [ "$pport" = "80" ]; then + pportsuffix="" +else + pportsuffix=":$pport" +fi mkdir -p $4 htdocs=`echo "import os; print os.path.realpath('$4')" | python` @@ -53,7 +58,7 @@ cat >$root/conf/httpd.conf <<EOF # Apache HTTPD server configuration # Main server name -ServerName http://$host:$pport +ServerName http://$host$pportsuffix PidFile $root/logs/httpd.pid # Load configured MPM @@ -150,11 +155,13 @@ Listen $listen # Setup HTTP virtual host <VirtualHost $vhost> -ServerName http://$host:$pport +ServerName http://$host$pportsuffix +<Location /> RewriteEngine on RewriteCond %{HTTP_HOST} !^$host [NC] -RewriteRule .* http://$host:$pport%{REQUEST_URI} [R,L] +RewriteRule .* http://$host$pportsuffix%{REQUEST_URI} [R] +</Location> Include conf/svhost.conf @@ -218,7 +225,6 @@ LoadModule rewrite_module ${modules_prefix}/modules/mod_rewrite.so LoadModule mime_module ${modules_prefix}/modules/mod_mime.so LoadModule status_module ${modules_prefix}/modules/mod_status.so LoadModule info_module ${modules_prefix}/modules/mod_info.so -LoadModule asis_module ${modules_prefix}/modules/mod_asis.so LoadModule negotiation_module ${modules_prefix}/modules/mod_negotiation.so LoadModule dir_module ${modules_prefix}/modules/mod_dir.so LoadModule setenvif_module ${modules_prefix}/modules/mod_setenvif.so diff --git a/sca-cpp/trunk/modules/http/httpd-ssl-conf b/sca-cpp/trunk/modules/http/httpd-ssl-conf index 9567c44cf1..50da9e6b54 100755 --- a/sca-cpp/trunk/modules/http/httpd-ssl-conf +++ b/sca-cpp/trunk/modules/http/httpd-ssl-conf @@ -31,6 +31,11 @@ pport=`$here/httpd-addr pport $gport` sslpport=`$here/httpd-addr pport $2` sslport=`$here/httpd-addr listen $2` sslvhost=`$here/httpd-addr vhost $2` +if [ "$sslpport" = "443" ]; then + sslpportsuffix="" +else + sslpportsuffix=":$sslpport" +fi htdocs=`echo $conf | awk '{ print $8 }'` mkdir -p $htdocs @@ -58,7 +63,13 @@ Listen $sslport # HTTPS virtual host <VirtualHost $sslvhost> -ServerName https://$host:$sslpport +ServerName https://$host$sslpportsuffix + +<Location /> +RewriteEngine on +RewriteCond %{HTTP_HOST} !^$host [NC] +RewriteRule .* https://$host$sslpportsuffix%{REQUEST_URI} [R] +</Location> Include conf/svhost-ssl.conf @@ -86,7 +97,7 @@ cat >>$root/conf/svhost.conf <<EOF RewriteEngine on RewriteCond %{SERVER_PORT} ^$port$ [OR] RewriteCond %{SERVER_PORT} ^$pport$ -RewriteRule .* https://$host:$sslpport%{REQUEST_URI} [R,L] +RewriteRule .* https://$host$sslpportsuffix%{REQUEST_URI} [R] </Location> EOF @@ -98,7 +109,7 @@ cat >>$root/conf/dvhost.conf <<EOF RewriteEngine on RewriteCond %{SERVER_PORT} ^$port$ [OR] RewriteCond %{SERVER_PORT} ^$pport$ -RewriteRule .* https://%{SERVER_NAME}:$sslpport%{REQUEST_URI} [R,L] +RewriteRule .* https://%{SERVER_NAME}$sslpportsuffix%{REQUEST_URI} [R] </Location> EOF diff --git a/sca-cpp/trunk/modules/http/httpd.hpp b/sca-cpp/trunk/modules/http/httpd.hpp index 3a651fa496..d413e6c288 100644 --- a/sca-cpp/trunk/modules/http/httpd.hpp +++ b/sca-cpp/trunk/modules/http/httpd.hpp @@ -43,7 +43,15 @@ #include <http_core.h> #include <http_connection.h> #include <http_request.h> +// Ignore conversion warnings in HTTPD 2.3.15 header +#ifdef WANT_MAINTAINER_MODE +#pragma GCC diagnostic ignored "-Wconversion" +#endif #include <http_protocol.h> +// Re-enable conversion warnings +#ifdef WANT_MAINTAINER_MODE +#pragma GCC diagnostic warning "-Wconversion" +#endif // Hack to workaround compile error with HTTPD 2.3.8 #define aplog_module_index aplog_module_index = 0 #include <http_log.h> |