diff options
Diffstat (limited to 'sca-cpp/trunk/modules')
23 files changed, 466 insertions, 78 deletions
diff --git a/sca-cpp/trunk/modules/http/Makefile.am b/sca-cpp/trunk/modules/http/Makefile.am index f25ef170c9..17fd8ac3c7 100644 --- a/sca-cpp/trunk/modules/http/Makefile.am +++ b/sca-cpp/trunk/modules/http/Makefile.am @@ -20,7 +20,7 @@ INCLUDES = -I${HTTPD_INCLUDE} incl_HEADERS = *.hpp incldir = $(prefix)/include/modules/http -dist_mod_SCRIPTS = httpd-conf httpd-start httpd-stop httpd-restart ssl-ca-conf ssl-cert-conf httpd-ssl-conf +dist_mod_SCRIPTS = httpd-conf httpd-start httpd-stop httpd-restart ssl-ca-conf ssl-cert-conf httpd-ssl-conf proxy-conf proxy-ssl-conf proxy-member-conf proxy-ssl-member-conf vhost-conf vhost-ssl-conf moddir=$(prefix)/modules/http curl_test_SOURCES = curl-test.cpp @@ -43,7 +43,7 @@ httpd-modules.prefix: $(top_builddir)/config.status curl.prefix: $(top_builddir)/config.status echo ${CURL_PREFIX} >curl.prefix -dist_noinst_SCRIPTS = httpd-test http-test +dist_noinst_SCRIPTS = httpd-test http-test proxy-test noinst_PROGRAMS = curl-test curl-get -TESTS = httpd-test http-test +TESTS = httpd-test http-test proxy-test diff --git a/sca-cpp/trunk/modules/http/httpd-conf b/sca-cpp/trunk/modules/http/httpd-conf index 70c0b295af..149bc56c4d 100755 --- a/sca-cpp/trunk/modules/http/httpd-conf +++ b/sca-cpp/trunk/modules/http/httpd-conf @@ -19,6 +19,7 @@ # Generate a minimal HTTPD configuration here=`readlink -f $0`; here=`dirname $here` +mkdir -p $1 root=`readlink -f $1` host=$2 port=`echo $3 | awk -F "/" '{ print $1 }'` @@ -26,19 +27,20 @@ pport=`echo $3 | awk -F "/" '{ print $2 }'` if [ "$pport" = "" ]; then pport=$port fi +mkdir -p $4 htdocs=`readlink -f $4` user=`id -un` group=`id -gn` modules_prefix=`cat $here/httpd-modules.prefix` -vhost=$5 mkdir -p $root mkdir -p $root/logs mkdir -p $root/conf cat >$root/conf/httpd.conf <<EOF +# Generated by: httpd-conf $* # Apache HTTPD server configuration -# Set server name +# Main server name ServerName http://$host:$pport PidFile $root/logs/httpd.pid @@ -114,37 +116,40 @@ Allow from all # Allow access to service components <Location /> Options FollowSymLinks +Order deny,allow Allow from all </Location> -# Setup HTTP virtual hosts +# Setup HTTP virtual host Listen $port <VirtualHost *:$port> ServerName http://$host:$pport -UseCanonicalName Off + +Include conf/svhost.conf </VirtualHost> EOF -# Generate mass dynamic virtual hosting configuration -if [ "$vhost" = "vhost" ]; then - -cat >>$root/conf/httpd.conf <<EOF -# Setup mass dynamic virtual hosting -NameVirtualHost *:$port - -<VirtualHost *:$port> -ServerName http://vhost.$host:$pport -ServerAlias *.$host +# Generate vhost configuration +cat >$root/conf/vhost.conf <<EOF +# Generated by: httpd-conf $* +# Virtual host configuration UseCanonicalName Off -VirtualDocumentRoot $htdocs/domains/%1/ -</VirtualHost> -# Isolate virtual host based requests -MaxRequestsPerChild 1 +EOF + +cat >$root/conf/svhost.conf <<EOF +# Generated by: httpd-conf $* +# Static virtual host configuration +Include conf/vhost.conf EOF -fi +cat >$root/conf/dvhost.conf <<EOF +# Generated by: httpd-conf $* +# Mass dynamic virtual host configuration +Include conf/vhost.conf + +EOF diff --git a/sca-cpp/trunk/modules/http/httpd-ssl-conf b/sca-cpp/trunk/modules/http/httpd-ssl-conf index 118ed708be..f2f8b01614 100755 --- a/sca-cpp/trunk/modules/http/httpd-ssl-conf +++ b/sca-cpp/trunk/modules/http/httpd-ssl-conf @@ -20,21 +20,24 @@ # Generate a minimal HTTPD SSL configuration here=`readlink -f $0`; here=`dirname $here` root=`readlink -f $1` -host=$2 -sslport=`echo $3 | awk -F "/" '{ print $1 }'` -sslpport=`echo $3 | awk -F "/" '{ print $2 }'` +conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` +host=`echo $conf | awk '{ print $6 }'` +port=`echo $conf | awk '{ print $7 }' | awk -F "/" '{ print $1 }'` +sslport=`echo $2 | awk -F "/" '{ print $1 }'` +sslpport=`echo $2 | awk -F "/" '{ print $2 }'` if [ "$sslpport" = "" ]; then sslpport=$sslport fi -htdocs=`readlink -f $4` +htdocs=`echo $conf | awk '{ print $8 }'` +htdocs=`readlink -f $htdocs` httpd_prefix=`cat $here/httpd.prefix` -vhost=$5 # Extract organization name from our CA certificate org=`openssl x509 -noout -subject -nameopt multiline -in $root/conf/ca.crt | grep organizationName | awk -F "= " '{ print $2 }'` # Generate HTTPD configuration cat >>$root/conf/httpd.conf <<EOF +# Generated by: httpd-ssl-conf $* # Redirect all HTTP traffic to HTTPS <Location /> RewriteEngine on @@ -52,27 +55,20 @@ SSLMutex "file:$root/logs/ssl_mutex" SSLRandomSeed startup builtin SSLRandomSeed connect builtin -# Setup HTTPS virtual hosts +# Setup HTTPS virtual host Listen $sslport -SSLCACertificateFile "$root/conf/ca.crt" -SSLCertificateFile "$root/conf/server.crt" -SSLCertificateKeyFile "$root/conf/server.key" - <VirtualHost *:$sslport> ServerName https://$host:$sslpport -UseCanonicalName Off -# Enable SSL -Include conf/ssl-vhost.conf +Include conf/ssl-svhost.conf # Allow the server admin to view the server status <Location /server-status> SetHandler server-status HostnameLookups on Deny from All -Allow from localhost -Allow from $host +Allow from all Require user admin </Location> @@ -81,13 +77,14 @@ Require user admin # Report extended server status ExtendedStatus On -# Route all wiring through HTTPS -SCAWiringServerName https://$host:$sslpport - EOF -# Generate VirtualHost SSL configuration +# Generate HTTPS vhost configuration cat >$root/conf/ssl-vhost.conf <<EOF +# Generated by: httpd-ssl-conf $* +# Virtual host configuration +UseCanonicalName Off + # Enable SSL SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL @@ -119,31 +116,32 @@ Require valid-user EOF -# Generate mass dynamic virtual hosting configuration -if [ "$vhost" = "vhost" ]; then +cat >$root/conf/ssl-svhost.conf <<EOF +# Generated by: httpd-ssl-conf $* +# Static virtual host configuration +Include conf/ssl-vhost.conf -cat >>$root/conf/httpd.conf <<EOF -# Setup mass dynamic virtual hosting -NameVirtualHost *:$sslport -SSLStrictSNIVHostCheck Off +# Configure SSL certificates +SSLCACertificateFile "$root/conf/ca.crt" +SSLCertificateChainFile "$root/conf/ca.crt" +SSLCertificateFile "$root/conf/server.crt" +SSLCertificateKeyFile "$root/conf/server.key" -<VirtualHost *:$sslport> -ServerName https://vhost.$host:$sslpport -ServerAlias *.$host -UseCanonicalName Off -VirtualDocumentRoot $htdocs/domains/%1/ +EOF -# Enable SSL +cat >$root/conf/ssl-dvhost.conf <<EOF +# Mass dynamic virtual host configuration +# Generated by: httpd-ssl-conf $* +Include conf/ssl-vhost.conf + +# Configure SSL certificates SSLCACertificateFile "$root/conf/ca.crt" +SSLCertificateChainFile "$root/conf/ca.crt" SSLCertificateFile "$root/conf/vhost.crt" SSLCertificateKeyFile "$root/conf/vhost.key" -Include conf/ssl-vhost.conf -</VirtualHost> EOF -fi - # Create test users for HTTP basic authentication $httpd_prefix/bin/htpasswd -bc $root/conf/httpd.passwd test test 2>/dev/null $httpd_prefix/bin/htpasswd -b $root/conf/httpd.passwd admin admin 2>/dev/null diff --git a/sca-cpp/trunk/modules/http/proxy-conf b/sca-cpp/trunk/modules/http/proxy-conf new file mode 100755 index 0000000000..4970950623 --- /dev/null +++ b/sca-cpp/trunk/modules/http/proxy-conf @@ -0,0 +1,40 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Generate a minimal HTTPD proxy balancer configuration +here=`readlink -f $0`; here=`dirname $here` +root=`readlink -f $1` + +cat >>$root/conf/vhost.conf <<EOF +# Generated by: proxy-conf $* +# Configure HTTP proxy and balancer +ProxyRequests Off +ProxyPreserveHost On +ProxyStatus On + +ProxyPass / balancer://cluster/ + +<Proxy balancer://cluster> +Order deny,allow +Allow from all +ProxySet lbmethod=byrequests +</Proxy> + +EOF + diff --git a/sca-cpp/trunk/modules/http/proxy-member-conf b/sca-cpp/trunk/modules/http/proxy-member-conf new file mode 100755 index 0000000000..73c448c065 --- /dev/null +++ b/sca-cpp/trunk/modules/http/proxy-member-conf @@ -0,0 +1,33 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Add a proxy balancer member +here=`readlink -f $0`; here=`dirname $here` +root=`readlink -f $1` +host=$2 +port=`echo $3 | awk -F "/" '{ print $1 }'` + +cat >>$root/conf/vhost.conf <<EOF +# Generated by: proxy-member-conf $* +# Add proxy balancer member +BalancerMember balancer://cluster http://$host:$port +ProxyPassReverse / http://$host:$port/ + +EOF + diff --git a/sca-cpp/trunk/modules/http/proxy-ssl-conf b/sca-cpp/trunk/modules/http/proxy-ssl-conf new file mode 100755 index 0000000000..bc1b63fc7d --- /dev/null +++ b/sca-cpp/trunk/modules/http/proxy-ssl-conf @@ -0,0 +1,70 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Generate a minimal HTTPD proxy balancer configuration +here=`readlink -f $0`; here=`dirname $here` +root=`readlink -f $1` + +cat >>$root/conf/ssl-vhost.conf <<EOF +# Generated by: proxy-ssl-conf $* +# Enable SSL proxy +SSLProxyEngine on +SSLProxyCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL + +# Configure proxy and balancer +ProxyRequests Off +ProxyPreserveHost On +ProxyStatus On + +ProxyPass /balancer-manager ! +ProxyPass / balancer://sslcluster/ + +<Proxy balancer://sslcluster> +Order deny,allow +Allow from all +ProxySet lbmethod=byrequests +</Proxy> + +# Enable balancer manager +<Location /balancer-manager> +SetHandler balancer-manager +HostnameLookups on +Deny from all +Allow from all +Require user admin +</Location> + +EOF + +cat >>$root/conf/ssl-svhost.conf <<EOF +# Generated by: proxy-ssl-conf $* +# Setup SSL proxy certificates +SSLProxyCACertificateFile "$root/conf/ca.crt" +SSLProxyMachineCertificateFile "$root/conf/server.pem" + +EOF + +cat >>$root/conf/ssl-dvhost.conf <<EOF +# Generated by: proxy-ssl-conf $* +# Setup SSL proxy certificates +SSLProxyCACertificateFile "$root/conf/ca.crt" +SSLProxyMachineCertificateFile "$root/conf/server.pem" + +EOF + diff --git a/sca-cpp/trunk/modules/http/proxy-ssl-member-conf b/sca-cpp/trunk/modules/http/proxy-ssl-member-conf new file mode 100755 index 0000000000..9f20933e35 --- /dev/null +++ b/sca-cpp/trunk/modules/http/proxy-ssl-member-conf @@ -0,0 +1,33 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Add a proxy balancer member +here=`readlink -f $0`; here=`dirname $here` +root=`readlink -f $1` +host=$2 +sslport=`echo $3 | awk -F "/" '{ print $1 }'` + +cat >>$root/conf/ssl-vhost.conf <<EOF +# Generated by: proxy-ssl-member-conf $* +# Add proxy balancer member +BalancerMember balancer://sslcluster https://$host:$sslport +ProxyPassReverse / https://$host:$sslport/ + +EOF + diff --git a/sca-cpp/trunk/modules/http/proxy-test b/sca-cpp/trunk/modules/http/proxy-test new file mode 100755 index 0000000000..b6c9a6a0d9 --- /dev/null +++ b/sca-cpp/trunk/modules/http/proxy-test @@ -0,0 +1,37 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Setup +./httpd-conf tmp localhost 8091/8090 htdocs +./httpd-start tmp +./httpd-conf tmp/proxy localhost 8090 tmp/proxy/htdocs +./proxy-conf tmp/proxy +./proxy-member-conf tmp/proxy localhost 8091 +./httpd-start tmp/proxy +sleep 2 + +# Test +./curl-test +rc=$? + +# Cleanup +./httpd-stop tmp/proxy +./httpd-stop tmp +sleep 2 +return $rc diff --git a/sca-cpp/trunk/modules/http/ssl-ca-conf b/sca-cpp/trunk/modules/http/ssl-ca-conf index c5a3f8e894..b3c6dbbfa0 100755 --- a/sca-cpp/trunk/modules/http/ssl-ca-conf +++ b/sca-cpp/trunk/modules/http/ssl-ca-conf @@ -19,6 +19,7 @@ # Generate a test certification authority certificate here=`readlink -f $0`; here=`dirname $here` +mkdir -p $1 root=`readlink -f $1` host=$2 diff --git a/sca-cpp/trunk/modules/http/ssl-cert-conf b/sca-cpp/trunk/modules/http/ssl-cert-conf index a7a1103d1a..959b5059e1 100755 --- a/sca-cpp/trunk/modules/http/ssl-cert-conf +++ b/sca-cpp/trunk/modules/http/ssl-cert-conf @@ -19,6 +19,7 @@ # Generate a test certificate here=`readlink -f $0`; here=`dirname $here` +mkdir -p $1 root=`readlink -f $1` host=$2 if [ "$3" != "" ]; then @@ -61,3 +62,8 @@ openssl ca -batch -config $root/conf/openssl-ca.conf -out $root/conf/$certname.c # Export it to PKCS12 format, that's the format Web browsers want to import openssl pkcs12 -export -passout pass: -out $root/conf/$certname.p12 -inkey $root/conf/$certname.key -in $root/conf/$certname.crt -certfile $root/conf/ca.crt +# Convert the certificate to PEM format and concatenate the key to it, for use +# by mod_proxy +openssl x509 -in $root/conf/$certname.crt -out $root/conf/$certname.pem +cat $root/conf/$certname.key >> $root/conf/$certname.pem + diff --git a/sca-cpp/trunk/modules/http/ssl-ls b/sca-cpp/trunk/modules/http/ssl-ls new file mode 100755 index 0000000000..71d40719ca --- /dev/null +++ b/sca-cpp/trunk/modules/http/ssl-ls @@ -0,0 +1,25 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Generate a test certification authority certificate +here=`readlink -f $0`; here=`dirname $here` +root=`readlink -f $1` + +ls $root/conf/*.crt $root/conf/*.key $root/conf/*.pem $root/conf/*.p12 2>/dev/null + diff --git a/sca-cpp/trunk/modules/http/vhost-conf b/sca-cpp/trunk/modules/http/vhost-conf new file mode 100755 index 0000000000..e49a1cd415 --- /dev/null +++ b/sca-cpp/trunk/modules/http/vhost-conf @@ -0,0 +1,47 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Generate mass dynamic virtual hosting configuration +here=`readlink -f $0`; here=`dirname $here` +root=`readlink -f $1` +conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` +host=`echo $conf | awk '{ print $6 }'` +port=`echo $conf | awk '{ print $7 }' | awk -F "/" '{ print $1 }'` +pport=`echo $conf | awk '{ print $7 }' | awk -F "/" '{ print $2 }'` +if [ "$pport" = "" ]; then + pport=$port +fi +htdocs=`echo $conf | awk '{ print $8 }'` +htdocs=`readlink -f $htdocs` + +cat >>$root/conf/httpd.conf <<EOF +# Generated by: vhost-conf $* +# Setup mass dynamic virtual hosting +NameVirtualHost *:$port + +<VirtualHost *:$port> +ServerName http://vhost.$host:$pport +ServerAlias *.$host +VirtualDocumentRoot $htdocs/domains/%1/ + +Include conf/dvhost.conf +</VirtualHost> + +EOF + diff --git a/sca-cpp/trunk/modules/http/vhost-ssl-conf b/sca-cpp/trunk/modules/http/vhost-ssl-conf new file mode 100755 index 0000000000..8a660278a3 --- /dev/null +++ b/sca-cpp/trunk/modules/http/vhost-ssl-conf @@ -0,0 +1,49 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Generate mass dynamic virtual hosting configuration +here=`readlink -f $0`; here=`dirname $here` +root=`readlink -f $1` +conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` +host=`echo $conf | awk '{ print $6 }'` +sslconf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-ssl-conf"` +sslport=`echo $sslconf | awk '{ print $6 }' | awk -F "/" '{ print $1 }'` +sslpport=`echo $sslconf | awk '{ print $6 }' | awk -F "/" '{ print $2 }'` +if [ "$sslpport" = "" ]; then + sslpport=$sslport +fi +htdocs=`echo $conf | awk '{ print $8 }'` +htdocs=`readlink -f $htdocs` + +cat >>$root/conf/httpd.conf <<EOF +# Generated by: vhost-ssl-conf $* +# Setup mass dynamic virtual hosting +NameVirtualHost *:$sslport +SSLStrictSNIVHostCheck Off + +<VirtualHost *:$sslport> +ServerName https://vhost.$host:$sslpport +ServerAlias *.$host +VirtualDocumentRoot $htdocs/domains/%1/ + +Include conf/ssl-dvhost.conf +</VirtualHost> + +EOF + diff --git a/sca-cpp/trunk/modules/java/java-conf b/sca-cpp/trunk/modules/java/java-conf index 4c03035ca4..e0690d50ec 100755 --- a/sca-cpp/trunk/modules/java/java-conf +++ b/sca-cpp/trunk/modules/java/java-conf @@ -22,6 +22,7 @@ here=`readlink -f $0`; here=`dirname $here` root=`readlink -f $1` cat >>$root/conf/httpd.conf <<EOF +# Generated by: java-conf $* # Support for Java SCA components LoadModule mod_tuscany_eval $here/libmod_tuscany_java.so diff --git a/sca-cpp/trunk/modules/openid/htdocs/logout/index.html b/sca-cpp/trunk/modules/openid/htdocs/logout/index.html index 6c7a9393cc..55cbfac110 100644 --- a/sca-cpp/trunk/modules/openid/htdocs/logout/index.html +++ b/sca-cpp/trunk/modules/openid/htdocs/logout/index.html @@ -20,11 +20,10 @@ <html><body> <h1>Sign out</h1> -<form name="signout" action="/" method="GET"> +<form name="signout" action="/login" method="GET"> <script type="text/javascript"> function submitSignout() { document.cookie = 'open_id_session_id=;expires=' + new Date(1970,01,01).toGMTString() + ';path=/'; - document.signout.action = "/login"; document.signout.submit(); return true; } diff --git a/sca-cpp/trunk/modules/openid/openid-conf b/sca-cpp/trunk/modules/openid/openid-conf index b98b4030c4..206281db38 100755 --- a/sca-cpp/trunk/modules/openid/openid-conf +++ b/sca-cpp/trunk/modules/openid/openid-conf @@ -20,17 +20,11 @@ # Generate an OpenID server conf here=`readlink -f $0`; here=`dirname $here` root=`readlink -f $1` -host=$2 -port=`echo $3 | awk -F "/" '{ print $1 }'` -pport=`echo $3 | awk -F "/" '{ print $2 }'` -if [ "$pport" = "" ]; then - pport=$port -fi -htdocs=`readlink -f $4` openid_prefix=`cat openid.prefix` # Configure HTTPD mod_auth_openid module cat >>$root/conf/httpd.conf <<EOF +# Generated by: openid-conf $* # Support for OpenID authentication LoadModule authopenid_module $openid_prefix/modules/mod_auth_openid.so diff --git a/sca-cpp/trunk/modules/openid/openid-step2-conf b/sca-cpp/trunk/modules/openid/openid-step2-conf index 4ca4150483..5e46f82d6a 100755 --- a/sca-cpp/trunk/modules/openid/openid-step2-conf +++ b/sca-cpp/trunk/modules/openid/openid-step2-conf @@ -20,16 +20,12 @@ # Generate an OpenID Step2 server conf here=`readlink -f $0`; here=`dirname $here` root=`readlink -f $1` -host=$2 -port=`echo $3 | awk -F "/" '{ print $1 }'` -pport=`echo $3 | awk -F "/" '{ print $2 }'` -if [ "$pport" = "" ]; then - pport=$port -fi -htdocs=`readlink -f $4` +conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` +host=`echo $conf | awk '{ print $6 }'` # Configure HTTPD to serve OpenID XRDS and LRDD documents cat >>$root/conf/httpd.conf <<EOF +# Generated by: openid-step2-conf $* # Serve OpenID XRDS document Alias /openid $root/conf/openid.xrds <Location /openid> diff --git a/sca-cpp/trunk/modules/openid/start-test b/sca-cpp/trunk/modules/openid/start-test index 11a0d0b511..b9d3191b11 100755 --- a/sca-cpp/trunk/modules/openid/start-test +++ b/sca-cpp/trunk/modules/openid/start-test @@ -19,8 +19,8 @@ # Setup ../../modules/http/httpd-conf tmp localhost 8090 htdocs -./openid-conf tmp localhost 8090 htdocs -./openid-step2-conf tmp localhost 8090 htdocs +./openid-conf tmp +./openid-step2-conf tmp ../../modules/server/server-conf tmp ../../modules/server/scheme-conf tmp cat >>tmp/conf/httpd.conf <<EOF diff --git a/sca-cpp/trunk/modules/python/python-conf b/sca-cpp/trunk/modules/python/python-conf index 983679db4d..d4bad3a6d2 100755 --- a/sca-cpp/trunk/modules/python/python-conf +++ b/sca-cpp/trunk/modules/python/python-conf @@ -22,6 +22,7 @@ here=`readlink -f $0`; here=`dirname $here` root=`readlink -f $1` cat >>$root/conf/httpd.conf <<EOF +# Generated by: python-conf $* # Support for Python SCA components LoadModule mod_tuscany_eval $here/libmod_tuscany_python.so diff --git a/sca-cpp/trunk/modules/server/cpp-conf b/sca-cpp/trunk/modules/server/cpp-conf index bc014ac979..0421e6bf12 100755 --- a/sca-cpp/trunk/modules/server/cpp-conf +++ b/sca-cpp/trunk/modules/server/cpp-conf @@ -22,6 +22,7 @@ here=`readlink -f $0`; here=`dirname $here` root=`readlink -f $1` cat >>$root/conf/httpd.conf <<EOF +# Generated by: cpp-conf $* # Support for C++ SCA components LoadModule mod_tuscany_eval $here/libmod_tuscany_eval.so diff --git a/sca-cpp/trunk/modules/server/mod-eval.hpp b/sca-cpp/trunk/modules/server/mod-eval.hpp index 829edef387..857fd0a1e1 100644 --- a/sca-cpp/trunk/modules/server/mod-eval.hpp +++ b/sca-cpp/trunk/modules/server/mod-eval.hpp @@ -769,9 +769,9 @@ const command_rec commands[] = { AP_INIT_TAKE1("SCAVirtualContribution", (const char*(*)())confVirtualContribution, NULL, RSRC_CONF, "SCA virtual host contribution location"), AP_INIT_TAKE1("SCAVirtualComposite", (const char*(*)())confVirtualComposite, NULL, RSRC_CONF, "SCA virtual composite location"), AP_INIT_TAKE12("SCASetEnv", (const char*(*)())confEnv, NULL, OR_FILEINFO, "Environment variable name and optional value"), - AP_INIT_TAKE1("SSLCACertificateFile", (const char*(*)())confCAFile, NULL, RSRC_CONF, "SSL CA certificate file"), - AP_INIT_TAKE1("SSLCertificateFile", (const char*(*)())confCertFile, NULL, RSRC_CONF, "SSL certificate file"), - AP_INIT_TAKE1("SSLCertificateKeyFile", (const char*(*)())confCertKeyFile, NULL, RSRC_CONF, "SSL certificate key file"), + AP_INIT_TAKE1("SCAWiringSSLCACertificateFile", (const char*(*)())confCAFile, NULL, RSRC_CONF, "SCA wiring SSL CA certificate file"), + AP_INIT_TAKE1("SCAWiringSSLCertificateFile", (const char*(*)())confCertFile, NULL, RSRC_CONF, "SCA wiring SSL certificate file"), + AP_INIT_TAKE1("SCAWiringSSLCertificateKeyFile", (const char*(*)())confCertKeyFile, NULL, RSRC_CONF, "SCA wiring SSL certificate key file"), {NULL, NULL, NULL, 0, NO_ARGS, NULL} }; diff --git a/sca-cpp/trunk/modules/server/scheme-conf b/sca-cpp/trunk/modules/server/scheme-conf index fc5f2b3ac8..8c3b26625b 100755 --- a/sca-cpp/trunk/modules/server/scheme-conf +++ b/sca-cpp/trunk/modules/server/scheme-conf @@ -22,6 +22,7 @@ here=`readlink -f $0`; here=`dirname $here` root=`readlink -f $1` cat >>$root/conf/httpd.conf <<EOF +# Generated by: scheme-conf $* # Support for Scheme SCA components LoadModule mod_tuscany_eval $here/libmod_tuscany_eval.so diff --git a/sca-cpp/trunk/modules/server/server-conf b/sca-cpp/trunk/modules/server/server-conf index 359a8ebc16..4a318c6fce 100755 --- a/sca-cpp/trunk/modules/server/server-conf +++ b/sca-cpp/trunk/modules/server/server-conf @@ -21,12 +21,63 @@ here=`readlink -f $0`; here=`dirname $here` root=`readlink -f $1` +conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` +host=`echo $conf | awk '{ print $6 }'` +port=`echo $conf | awk '{ print $7 }' | awk -F "/" '{ print $1 }'` +pport=`echo $conf | awk '{ print $7 }' | awk -F "/" '{ print $2 }'` +if [ "$pport" = "" ]; then + pport=$port +fi +servername="http://$host:$pport" + +sslconf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-ssl-conf"` +if [ "$sslconf" != "" ]; then + sslport=`echo $sslconf | awk '{ print $6 }' | awk -F "/" '{ print $1 }'` + sslpport=`echo $sslconf | awk '{ print $6 }' | awk -F "/" '{ print $2 }'` + if [ "$sslpport" = "" ]; then + sslpport=$sslport + fi + servername="https://$host:$sslpport" +fi + cat >>$root/conf/httpd.conf <<EOF +# Generated by: server-conf $* # Support for SCA component wiring LoadModule mod_tuscany_wiring $here/libmod_tuscany_wiring.so +# Route all wiring through the configured server name +SCAWiringServerName $servername + # Serve HTTP binding JavaScript client code Alias /js/tuscany-ref.js $here/htdocs/js/tuscany-ref.js EOF +ssl=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-ssl-conf"` +if [ "$ssl" != "" ]; then + cat >>$root/conf/httpd.conf <<EOF +# Configure SSL certificates +SCAWiringSSLCACertificateFile "$root/conf/ca.crt" +SCAWiringSSLCertificateFile "$root/conf/server.crt" +SCAWiringSSLCertificateKeyFile "$root/conf/server.key" + +EOF + +fi + +vhost=`cat $root/conf/httpd.conf | grep VirtualDocumentRoot` +proxy=`cat $root/conf/httpd.conf | grep ProxyPass` + +vhost=`cat $root/conf/httpd.conf | grep "# Generated by: vhost-conf"` +if [ "$vhost" != "" ]; then + proxy=`cat $root/conf/httpd.conf | grep "# Generated by: proxy-conf"` + if [ "$proxy" = "" ]; then + cat >>$root/conf/httpd.conf <<EOF +# Isolate requests from different virtual hosts +MaxRequestsPerChild 1 + +EOF + + fi +fi + |