diff options
Diffstat (limited to 'sca-cpp/trunk/modules')
-rwxr-xr-x | sca-cpp/trunk/modules/http/httpd-conf | 12 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/http/httpd-ssl-conf | 13 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/openid/openid-conf | 11 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/server/server-conf | 3 |
4 files changed, 32 insertions, 7 deletions
diff --git a/sca-cpp/trunk/modules/http/httpd-conf b/sca-cpp/trunk/modules/http/httpd-conf index 35c6c78254..b281874d92 100755 --- a/sca-cpp/trunk/modules/http/httpd-conf +++ b/sca-cpp/trunk/modules/http/httpd-conf @@ -21,7 +21,11 @@ here=`readlink -f $0`; here=`dirname $here` root=`readlink -f $1` host=$2 -port=$3 +port=`echo $3 | awk -F "/" '{ print $1 }'` +pport=`echo $3 | awk -F "/" '{ print $2 }'` +if [ "$pport" = "" ]; then + pport=$port +fi htdocs=`readlink -f $4` user=`id -un` group=`id -gn` @@ -34,7 +38,9 @@ cat >$root/conf/httpd.conf <<EOF # Apache HTTPD server configuration # Set server name -ServerName $host +ServerName $host:$pport +UseCanonicalName On +UseCanonicalPhysicalPort off PidFile $root/logs/httpd.pid # Minimal set of modules @@ -114,7 +120,7 @@ Allow from all # Setup HTTP virtual host Listen $port <VirtualHost _default_:$port> - +ServerName $host:$pport </VirtualHost> EOF diff --git a/sca-cpp/trunk/modules/http/httpd-ssl-conf b/sca-cpp/trunk/modules/http/httpd-ssl-conf index 6f763c6a66..16b2322809 100755 --- a/sca-cpp/trunk/modules/http/httpd-ssl-conf +++ b/sca-cpp/trunk/modules/http/httpd-ssl-conf @@ -21,7 +21,11 @@ here=`readlink -f $0`; here=`dirname $here` root=`readlink -f $1` host=$2 -sslport=$3 +sslport=`echo $3 | awk -F "/" '{ print $1 }'` +sslpport=`echo $3 | awk -F "/" '{ print $2 }'` +if [ "$sslpport" = "" ]; then + sslpport=$sslport +fi htdocs=`readlink -f $4` httpd_prefix=`cat $here/httpd.prefix` @@ -33,8 +37,8 @@ cat >>$root/conf/httpd.conf <<EOF # Redirect all HTTP traffic to HTTPS <Location /> RewriteEngine on -RewriteCond %{SERVER_PORT} !^$sslport$ -RewriteRule .* https://%{SERVER_NAME}:$sslport%{REQUEST_URI} [R,L] +RewriteCond %{SERVER_PORT} !^$sslpport$ +RewriteRule .* https://%{SERVER_NAME}:$sslpport%{REQUEST_URI} [R,L] </Location> # Setup SSL support @@ -50,6 +54,9 @@ SSLRandomSeed connect builtin # HTTPS virtual host Listen $sslport <VirtualHost _default_:$sslport> +ServerName $host:$sslpport +UseCanonicalName On +UseCanonicalPhysicalPort off # Enable SSL SSLEngine on diff --git a/sca-cpp/trunk/modules/openid/openid-conf b/sca-cpp/trunk/modules/openid/openid-conf index 5085d741cc..2d30502ea6 100755 --- a/sca-cpp/trunk/modules/openid/openid-conf +++ b/sca-cpp/trunk/modules/openid/openid-conf @@ -23,6 +23,14 @@ root=`readlink -f $1` htdocs=`readlink -f $2` openid_prefix=`cat openid.prefix` +servername=`cat $root/conf/httpd.conf | grep ServerName | tail -1 | awk '{ print $2 }'` +ssl=`cat $root/conf/httpd.conf | grep "SSLEngine" | awk '{ print $2 }'` +if [ "$ssl" = "on" ]; then + protocol="https" +else + protocol="http" +fi + # Configure HTTPD mod_auth_openid module cat >>$root/conf/httpd.conf <<EOF # Support for OpenID authentication @@ -33,6 +41,7 @@ AuthOpenIDEnabled On AuthOpenIDCookiePath / AuthOpenIDLoginPage /protected/login AuthOpenIDAXAdd EMAIL http://axschema.org/contact/email +AuthOpenIDServerName $servername </Location> <Location /components> @@ -40,6 +49,7 @@ AuthOpenIDEnabled On AuthOpenIDCookiePath / AuthOpenIDLoginPage /protected/login AuthOpenIDAXAdd EMAIL http://axschema.org/contact/email +AuthOpenIDServerName $servername </Location> <Location /references> @@ -47,6 +57,7 @@ AuthOpenIDEnabled On AuthOpenIDCookiePath / AuthOpenIDLoginPage /protected/login AuthOpenIDAXAdd EMAIL http://axschema.org/contact/email +AuthOpenIDServerName $servername </Location> <Location /protected/login> diff --git a/sca-cpp/trunk/modules/server/server-conf b/sca-cpp/trunk/modules/server/server-conf index c430d53de2..7cc8914f85 100755 --- a/sca-cpp/trunk/modules/server/server-conf +++ b/sca-cpp/trunk/modules/server/server-conf @@ -21,7 +21,8 @@ here=`readlink -f $0`; here=`dirname $here` root=`readlink -f $1` -host=`cat $root/conf/httpd.conf | grep ServerName | awk '{ print $2 }'` +servername=`cat $root/conf/httpd.conf | grep ServerName | tail -1 | awk '{ print $2 }'` +host=`echo $servername | awk -F ":" '{ print $1 }'` port=`cat $root/conf/httpd.conf | grep Listen | tail -1 | awk '{ print $2 }'` ssl=`cat $root/conf/httpd.conf | grep "SSLEngine" | awk '{ print $2 }'` |