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/07/28 11:50:14 UTC

svn commit: r980009 [1/2] - in /tuscany/sca-cpp/trunk: ./ components/log/ components/webservice/ modules/http/ modules/java/ modules/openid/ modules/openid/htdocs/logout/ modules/python/ modules/server/ samples/ samples/store-cluster/ samples/store-clu...

Author: jsdelfino
Date: Wed Jul 28 09:50:12 2010
New Revision: 980009

URL: http://svn.apache.org/viewvc?rev=980009&view=rev
Log:
Refactor and cleanup some of the config scripts. Add a sample using mod_proxy_balancer to distribute requests across three servers.

Added:
    tuscany/sca-cpp/trunk/modules/http/proxy-conf
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/server/server-conf
    tuscany/sca-cpp/trunk/modules/http/proxy-member-conf
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/server/server-conf
    tuscany/sca-cpp/trunk/modules/http/proxy-ssl-conf   (with props)
    tuscany/sca-cpp/trunk/modules/http/proxy-ssl-member-conf
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/server/server-conf
    tuscany/sca-cpp/trunk/modules/http/proxy-test
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/server/scheme-conf
    tuscany/sca-cpp/trunk/modules/http/ssl-ls
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/server/cpp-conf
    tuscany/sca-cpp/trunk/modules/http/vhost-conf
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/openid/openid-conf
    tuscany/sca-cpp/trunk/modules/http/vhost-ssl-conf
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/openid/openid-conf
    tuscany/sca-cpp/trunk/samples/store-cluster/
    tuscany/sca-cpp/trunk/samples/store-cluster/Makefile.am   (contents, props changed)
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/server/server-conf
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/currency-converter.py   (contents, props changed)
      - copied, changed from r978945, tuscany/sca-cpp/trunk/samples/store-python/redirect
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/fruits-catalog.py   (contents, props changed)
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/openid/start-test
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/shopping-cart.py
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.composite
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.py   (contents, props changed)
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/server/server-conf
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/currency-converter.py   (contents, props changed)
      - copied, changed from r978945, tuscany/sca-cpp/trunk/samples/store-python/redirect
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/fruits-catalog.py   (contents, props changed)
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/openid/start-test
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/shopping-cart.py
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.composite
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.py   (contents, props changed)
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/server/server-conf
    tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/
    tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/
    tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/
    tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html
    tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/
    tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html
    tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/index.html
    tuscany/sca-cpp/trunk/samples/store-cluster/server-test   (with props)
    tuscany/sca-cpp/trunk/samples/store-cluster/ssl-start   (with props)
    tuscany/sca-cpp/trunk/samples/store-cluster/start   (with props)
    tuscany/sca-cpp/trunk/samples/store-cluster/stop
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/java/java-conf
    tuscany/sca-cpp/trunk/ubuntu/ip-redirect-all
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/java/java-conf
    tuscany/sca-cpp/trunk/ubuntu/uec2-bin-all-image
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/server/scheme-conf
    tuscany/sca-cpp/trunk/ubuntu/uec2-dev-all-image
      - copied, changed from r978945, tuscany/sca-cpp/trunk/modules/server/scheme-conf
Modified:
    tuscany/sca-cpp/trunk/components/log/scribed-central-conf
    tuscany/sca-cpp/trunk/components/log/scribed-client-conf
    tuscany/sca-cpp/trunk/components/webservice/axis2-conf
    tuscany/sca-cpp/trunk/configure.ac
    tuscany/sca-cpp/trunk/modules/http/Makefile.am
    tuscany/sca-cpp/trunk/modules/http/httpd-conf
    tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf
    tuscany/sca-cpp/trunk/modules/http/ssl-ca-conf
    tuscany/sca-cpp/trunk/modules/http/ssl-cert-conf
    tuscany/sca-cpp/trunk/modules/java/java-conf
    tuscany/sca-cpp/trunk/modules/openid/htdocs/logout/index.html
    tuscany/sca-cpp/trunk/modules/openid/openid-conf
    tuscany/sca-cpp/trunk/modules/openid/openid-step2-conf
    tuscany/sca-cpp/trunk/modules/openid/start-test
    tuscany/sca-cpp/trunk/modules/python/python-conf
    tuscany/sca-cpp/trunk/modules/server/cpp-conf
    tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp
    tuscany/sca-cpp/trunk/modules/server/scheme-conf
    tuscany/sca-cpp/trunk/modules/server/server-conf
    tuscany/sca-cpp/trunk/samples/Makefile.am
    tuscany/sca-cpp/trunk/samples/store-cpp/ssl-start
    tuscany/sca-cpp/trunk/samples/store-java/ssl-start
    tuscany/sca-cpp/trunk/samples/store-nosql/ssl-start
    tuscany/sca-cpp/trunk/samples/store-python/redirect
    tuscany/sca-cpp/trunk/samples/store-python/ssl-start
    tuscany/sca-cpp/trunk/samples/store-python/uec2-start
    tuscany/sca-cpp/trunk/samples/store-scheme/ssl-start
    tuscany/sca-cpp/trunk/samples/store-sql/ssl-start
    tuscany/sca-cpp/trunk/samples/store-vhost/ssl-start
    tuscany/sca-cpp/trunk/samples/store-vhost/start
    tuscany/sca-cpp/trunk/samples/store-vhost/uec2-start
    tuscany/sca-cpp/trunk/ubuntu/Makefile.am
    tuscany/sca-cpp/trunk/ubuntu/ip-redirect

Modified: tuscany/sca-cpp/trunk/components/log/scribed-central-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/log/scribed-central-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/log/scribed-central-conf (original)
+++ tuscany/sca-cpp/trunk/components/log/scribed-central-conf Wed Jul 28 09:50:12 2010
@@ -19,6 +19,7 @@
 
 # Generate a Scribe central conf
 here=`readlink -f $0`; here=`dirname $here`
+mkdir -p $1
 root=`readlink -f $1`
 
 mkdir -p $root/scribe/conf
@@ -26,6 +27,7 @@ mkdir -p $root/scribe/logs/central
 mkdir -p $root/scribe/logs/central-secondary
 
 cat >$root/scribe/conf/scribe-central.conf <<EOF
+# Generated by: scribed-central-conf $*
 # Scribe central configuration
 port=1463
 max_msg_per_second=2000000

Modified: tuscany/sca-cpp/trunk/components/log/scribed-client-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/log/scribed-client-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/log/scribed-client-conf (original)
+++ tuscany/sca-cpp/trunk/components/log/scribed-client-conf Wed Jul 28 09:50:12 2010
@@ -19,6 +19,7 @@
 
 # Generate a Scribe client conf
 here=`readlink -f $0`; here=`dirname $here`
+mkdir -p $1
 root=`readlink -f $1`
 central=$2
 
@@ -26,6 +27,7 @@ mkdir -p $root/scribe/conf
 mkdir -p $root/scribe/logs/client-secondary
 
 cat >$root/scribe/conf/scribe-client.conf <<EOF
+# Generated by: scribed-client-conf $*
 # Scribe client configuration
 port=1464
 max_msg_per_second=2000000

Modified: tuscany/sca-cpp/trunk/components/webservice/axis2-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/webservice/axis2-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/webservice/axis2-conf (original)
+++ tuscany/sca-cpp/trunk/components/webservice/axis2-conf Wed Jul 28 09:50:12 2010
@@ -42,6 +42,7 @@ cp $here/axis2.xml $root/axis2c/axis2.xm
 
 # Configure HTTPD Axis2 module
 cat >>$root/conf/httpd.conf <<EOF
+# Generated by: axis2-conf $*
 # Support for Web Services
 SCASetEnv AXIS2C_HOME $root/axis2c
 LoadModule axis2_module $root/axis2c/lib/libmod_axis2.so

Modified: tuscany/sca-cpp/trunk/configure.ac
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/configure.ac?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/configure.ac (original)
+++ tuscany/sca-cpp/trunk/configure.ac Wed Jul 28 09:50:12 2010
@@ -860,6 +860,7 @@ AC_CONFIG_FILES([Makefile
                  samples/store-sql/Makefile
                  samples/store-nosql/Makefile
                  samples/store-vhost/Makefile
+                 samples/store-cluster/Makefile
                  doc/Makefile
                  doc/Doxyfile
                  ubuntu/Makefile

Modified: tuscany/sca-cpp/trunk/modules/http/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/Makefile.am?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/http/Makefile.am Wed Jul 28 09:50:12 2010
@@ -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)/co
 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
 

Modified: tuscany/sca-cpp/trunk/modules/http/httpd-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd-conf Wed Jul 28 09:50:12 2010
@@ -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
 

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=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf Wed Jul 28 09:50:12 2010
@@ -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

Copied: tuscany/sca-cpp/trunk/modules/http/proxy-conf (from r978945, tuscany/sca-cpp/trunk/modules/server/server-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/proxy-conf?p2=tuscany/sca-cpp/trunk/modules/http/proxy-conf&p1=tuscany/sca-cpp/trunk/modules/server/server-conf&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/server-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/proxy-conf Wed Jul 28 09:50:12 2010
@@ -17,16 +17,24 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a server conf
+# Generate a minimal HTTPD proxy balancer configuration
 here=`readlink -f $0`; here=`dirname $here`
 root=`readlink -f $1`
 
-cat >>$root/conf/httpd.conf <<EOF
-# Support for SCA component wiring
-LoadModule mod_tuscany_wiring $here/libmod_tuscany_wiring.so
+cat >>$root/conf/vhost.conf <<EOF
+# Generated by: proxy-conf $*
+# Configure HTTP proxy and balancer
+ProxyRequests Off
+ProxyPreserveHost On
+ProxyStatus On
 
-# Serve HTTP binding JavaScript client code
-Alias /js/tuscany-ref.js $here/htdocs/js/tuscany-ref.js
+ProxyPass / balancer://cluster/
+
+<Proxy balancer://cluster>
+Order deny,allow
+Allow from all
+ProxySet lbmethod=byrequests
+</Proxy>
 
 EOF
 

Copied: tuscany/sca-cpp/trunk/modules/http/proxy-member-conf (from r978945, tuscany/sca-cpp/trunk/modules/server/server-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/proxy-member-conf?p2=tuscany/sca-cpp/trunk/modules/http/proxy-member-conf&p1=tuscany/sca-cpp/trunk/modules/server/server-conf&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/server-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/proxy-member-conf Wed Jul 28 09:50:12 2010
@@ -17,16 +17,17 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a server conf
+# 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/httpd.conf <<EOF
-# Support for SCA component wiring
-LoadModule mod_tuscany_wiring $here/libmod_tuscany_wiring.so
-
-# Serve HTTP binding JavaScript client code
-Alias /js/tuscany-ref.js $here/htdocs/js/tuscany-ref.js
+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
 

Added: tuscany/sca-cpp/trunk/modules/http/proxy-ssl-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/proxy-ssl-conf?rev=980009&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/proxy-ssl-conf (added)
+++ tuscany/sca-cpp/trunk/modules/http/proxy-ssl-conf Wed Jul 28 09:50:12 2010
@@ -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
+

Propchange: tuscany/sca-cpp/trunk/modules/http/proxy-ssl-conf
------------------------------------------------------------------------------
    svn:executable = *

Copied: tuscany/sca-cpp/trunk/modules/http/proxy-ssl-member-conf (from r978945, tuscany/sca-cpp/trunk/modules/server/server-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/proxy-ssl-member-conf?p2=tuscany/sca-cpp/trunk/modules/http/proxy-ssl-member-conf&p1=tuscany/sca-cpp/trunk/modules/server/server-conf&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/server-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/proxy-ssl-member-conf Wed Jul 28 09:50:12 2010
@@ -17,16 +17,17 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a server conf
+# 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/httpd.conf <<EOF
-# Support for SCA component wiring
-LoadModule mod_tuscany_wiring $here/libmod_tuscany_wiring.so
-
-# Serve HTTP binding JavaScript client code
-Alias /js/tuscany-ref.js $here/htdocs/js/tuscany-ref.js
+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
 

Copied: tuscany/sca-cpp/trunk/modules/http/proxy-test (from r978945, tuscany/sca-cpp/trunk/modules/server/scheme-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/proxy-test?p2=tuscany/sca-cpp/trunk/modules/http/proxy-test&p1=tuscany/sca-cpp/trunk/modules/server/scheme-conf&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/scheme-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/proxy-test Wed Jul 28 09:50:12 2010
@@ -17,12 +17,21 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a Scheme server conf
-here=`readlink -f $0`; here=`dirname $here`
-root=`readlink -f $1`
+# 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
 
-cat >>$root/conf/httpd.conf <<EOF
-# Support for Scheme SCA components
-LoadModule mod_tuscany_eval $here/libmod_tuscany_eval.so
+# Test
+./curl-test
+rc=$?
 
-EOF
+# Cleanup
+./httpd-stop tmp/proxy
+./httpd-stop tmp
+sleep 2
+return $rc

Modified: tuscany/sca-cpp/trunk/modules/http/ssl-ca-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/ssl-ca-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/ssl-ca-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/ssl-ca-conf Wed Jul 28 09:50:12 2010
@@ -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
 

Modified: tuscany/sca-cpp/trunk/modules/http/ssl-cert-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/ssl-cert-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/ssl-cert-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/ssl-cert-conf Wed Jul 28 09:50:12 2010
@@ -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/ope
 # 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
+

Copied: tuscany/sca-cpp/trunk/modules/http/ssl-ls (from r978945, tuscany/sca-cpp/trunk/modules/server/cpp-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/ssl-ls?p2=tuscany/sca-cpp/trunk/modules/http/ssl-ls&p1=tuscany/sca-cpp/trunk/modules/server/cpp-conf&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/cpp-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/ssl-ls Wed Jul 28 09:50:12 2010
@@ -17,12 +17,9 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a C++ server conf
+# Generate a test certification authority certificate
 here=`readlink -f $0`; here=`dirname $here`
 root=`readlink -f $1`
 
-cat >>$root/conf/httpd.conf <<EOF
-# Support for C++ SCA components
-LoadModule mod_tuscany_eval $here/libmod_tuscany_eval.so
+ls $root/conf/*.crt $root/conf/*.key $root/conf/*.pem $root/conf/*.p12 2>/dev/null
 
-EOF

Copied: tuscany/sca-cpp/trunk/modules/http/vhost-conf (from r978945, tuscany/sca-cpp/trunk/modules/openid/openid-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/vhost-conf?p2=tuscany/sca-cpp/trunk/modules/http/vhost-conf&p1=tuscany/sca-cpp/trunk/modules/openid/openid-conf&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/openid/openid-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/vhost-conf Wed Jul 28 09:50:12 2010
@@ -17,41 +17,31 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate an OpenID server conf
+# Generate mass dynamic virtual hosting configuration
 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 }'`
+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=`readlink -f $4`
-openid_prefix=`cat openid.prefix`
+htdocs=`echo $conf | awk '{ print $8 }'`
+htdocs=`readlink -f $htdocs`
 
-# Configure HTTPD mod_auth_openid module
 cat >>$root/conf/httpd.conf <<EOF
-# Support for OpenID authentication
-LoadModule authopenid_module  $openid_prefix/modules/mod_auth_openid.so
+# Generated by: vhost-conf $*
+# Setup mass dynamic virtual hosting
+NameVirtualHost *:$port
+
+<VirtualHost *:$port>
+ServerName http://vhost.$host:$pport
+ServerAlias *.$host
+VirtualDocumentRoot $htdocs/domains/%1/
 
-<Location />
-AuthOpenIDEnabled On
-AuthOpenIDCookiePath /
-AuthOpenIDLoginPage /login
-AuthOpenIDAXAdd EMAIL http://axschema.org/contact/email
-</Location>
-
-<Location /unprotected>
-AuthOpenIDEnabled Off
-</Location>
-
-<Location /login>
-AuthOpenIDEnabled Off
-</Location>
-
-<Location /logout>
-AuthOpenIDEnabled Off
-</Location>
+Include conf/dvhost.conf
+</VirtualHost>
 
 EOF
 

Copied: tuscany/sca-cpp/trunk/modules/http/vhost-ssl-conf (from r978945, tuscany/sca-cpp/trunk/modules/openid/openid-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/vhost-ssl-conf?p2=tuscany/sca-cpp/trunk/modules/http/vhost-ssl-conf&p1=tuscany/sca-cpp/trunk/modules/openid/openid-conf&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/openid/openid-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/vhost-ssl-conf Wed Jul 28 09:50:12 2010
@@ -17,41 +17,33 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate an OpenID server conf
+# Generate mass dynamic virtual hosting configuration
 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
+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=`readlink -f $4`
-openid_prefix=`cat openid.prefix`
+htdocs=`echo $conf | awk '{ print $8 }'`
+htdocs=`readlink -f $htdocs`
 
-# Configure HTTPD mod_auth_openid module
 cat >>$root/conf/httpd.conf <<EOF
-# Support for OpenID authentication
-LoadModule authopenid_module  $openid_prefix/modules/mod_auth_openid.so
+# 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/
 
-<Location />
-AuthOpenIDEnabled On
-AuthOpenIDCookiePath /
-AuthOpenIDLoginPage /login
-AuthOpenIDAXAdd EMAIL http://axschema.org/contact/email
-</Location>
-
-<Location /unprotected>
-AuthOpenIDEnabled Off
-</Location>
-
-<Location /login>
-AuthOpenIDEnabled Off
-</Location>
-
-<Location /logout>
-AuthOpenIDEnabled Off
-</Location>
+Include conf/ssl-dvhost.conf
+</VirtualHost>
 
 EOF
 

Modified: tuscany/sca-cpp/trunk/modules/java/java-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/java/java-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/java/java-conf (original)
+++ tuscany/sca-cpp/trunk/modules/java/java-conf Wed Jul 28 09:50:12 2010
@@ -22,6 +22,7 @@ here=`readlink -f $0`; here=`dirname $he
 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
 

Modified: tuscany/sca-cpp/trunk/modules/openid/htdocs/logout/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/openid/htdocs/logout/index.html?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/openid/htdocs/logout/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/openid/htdocs/logout/index.html Wed Jul 28 09:50:12 2010
@@ -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;
 }

Modified: tuscany/sca-cpp/trunk/modules/openid/openid-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/openid/openid-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/openid/openid-conf (original)
+++ tuscany/sca-cpp/trunk/modules/openid/openid-conf Wed Jul 28 09:50:12 2010
@@ -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
 

Modified: tuscany/sca-cpp/trunk/modules/openid/openid-step2-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/openid/openid-step2-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/openid/openid-step2-conf (original)
+++ tuscany/sca-cpp/trunk/modules/openid/openid-step2-conf Wed Jul 28 09:50:12 2010
@@ -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>

Modified: tuscany/sca-cpp/trunk/modules/openid/start-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/openid/start-test?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/openid/start-test (original)
+++ tuscany/sca-cpp/trunk/modules/openid/start-test Wed Jul 28 09:50:12 2010
@@ -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

Modified: tuscany/sca-cpp/trunk/modules/python/python-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/python-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/python-conf (original)
+++ tuscany/sca-cpp/trunk/modules/python/python-conf Wed Jul 28 09:50:12 2010
@@ -22,6 +22,7 @@ here=`readlink -f $0`; here=`dirname $he
 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
 

Modified: tuscany/sca-cpp/trunk/modules/server/cpp-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/cpp-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/cpp-conf (original)
+++ tuscany/sca-cpp/trunk/modules/server/cpp-conf Wed Jul 28 09:50:12 2010
@@ -22,6 +22,7 @@ here=`readlink -f $0`; here=`dirname $he
 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
 

Modified: tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp Wed Jul 28 09:50:12 2010
@@ -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}
 };
 

Modified: tuscany/sca-cpp/trunk/modules/server/scheme-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/scheme-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/scheme-conf (original)
+++ tuscany/sca-cpp/trunk/modules/server/scheme-conf Wed Jul 28 09:50:12 2010
@@ -22,6 +22,7 @@ here=`readlink -f $0`; here=`dirname $he
 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
 

Modified: tuscany/sca-cpp/trunk/modules/server/server-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/server-conf?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/server-conf (original)
+++ tuscany/sca-cpp/trunk/modules/server/server-conf Wed Jul 28 09:50:12 2010
@@ -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
+

Modified: tuscany/sca-cpp/trunk/samples/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/Makefile.am?rev=980009&r1=980008&r2=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/samples/Makefile.am Wed Jul 28 09:50:12 2010
@@ -15,7 +15,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-SUBDIRS = store-scheme store-cpp store-python store-java store-gae store-sql store-nosql store-vhost
+SUBDIRS = store-scheme store-cpp store-python store-java store-gae store-sql store-nosql store-vhost store-cluster
 
 sample_DATA = README
 sampledir=$(prefix)/samples

Copied: tuscany/sca-cpp/trunk/samples/store-cluster/Makefile.am (from r978945, tuscany/sca-cpp/trunk/modules/server/server-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/Makefile.am?p2=tuscany/sca-cpp/trunk/samples/store-cluster/Makefile.am&p1=tuscany/sca-cpp/trunk/modules/server/server-conf&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/server-conf (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/Makefile.am Wed Jul 28 09:50:12 2010
@@ -1,5 +1,3 @@
-#!/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
@@ -17,16 +15,22 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a server conf
-here=`readlink -f $0`; here=`dirname $here`
-root=`readlink -f $1`
-
-cat >>$root/conf/httpd.conf <<EOF
-# Support for SCA component wiring
-LoadModule mod_tuscany_wiring $here/libmod_tuscany_wiring.so
-
-# Serve HTTP binding JavaScript client code
-Alias /js/tuscany-ref.js $here/htdocs/js/tuscany-ref.js
-
-EOF
-
+if WANT_PYTHON
+if WANT_SQLDB
+if WANT_OPENID
+if WANT_LOG
+if WANT_QUEUE
+
+dist_sample_SCRIPTS = start stop ssl-start
+sampledir = $(prefix)/samples/store-cluster
+
+nobase_dist_sample_DATA = htdocs/*.html htdocs/domains/*/*.html domains/*/*.py domains/*/*.composite
+
+dist_noinst_SCRIPTS = server-test
+#TESTS = server-test
+
+endif
+endif
+endif
+endif
+endif

Copied: tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/currency-converter.py (from r978945, tuscany/sca-cpp/trunk/samples/store-python/redirect)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/currency-converter.py?p2=tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/currency-converter.py&p1=tuscany/sca-cpp/trunk/samples/store-python/redirect&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-python/redirect (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/currency-converter.py Wed Jul 28 09:50:12 2010
@@ -1,5 +1,3 @@
-#!/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
@@ -17,8 +15,15 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Redirect ports 80 and 443
-intf=$1
-../../ubuntu/ip-redirect 80 8090 $intf
-../../ubuntu/ip-redirect 443 8453 $intf
+# Currency converter implementation
+
+def convert(fr, to, amount):
+    if to == "EUR":
+        return amount * 0.70
+    return amount
+
+def symbol(currency):
+    if currency == "EUR":
+        return "E"
+    return "$"
 

Copied: tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/fruits-catalog.py (from r978945, tuscany/sca-cpp/trunk/modules/openid/start-test)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/fruits-catalog.py?p2=tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/fruits-catalog.py&p1=tuscany/sca-cpp/trunk/modules/openid/start-test&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/openid/start-test (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/fruits-catalog.py Wed Jul 28 09:50:12 2010
@@ -1,5 +1,3 @@
-#!/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
@@ -17,16 +15,16 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Setup
-../../modules/http/httpd-conf tmp localhost 8090 htdocs
-./openid-conf tmp localhost 8090 htdocs
-./openid-step2-conf tmp localhost 8090 htdocs
-../../modules/server/server-conf tmp
-../../modules/server/scheme-conf tmp
-cat >>tmp/conf/httpd.conf <<EOF
-SCAContribution `pwd`/
-SCAComposite openid.composite
-EOF
+# Catalog implementation
 
-../../modules/http/httpd-start tmp
+def getcatalog(converter, currencyCode):
+  code = currencyCode()
+  def convert(price):
+      return converter("convert", "USD", code, price)
+  symbol = converter("symbol", code)
+  return (
+    (("'javaClass", "services.Item"), ("'name", "Passion"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(2.99))),
+    (("'javaClass", "services.Item"), ("'name", "Mango"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(3.55))),
+    (("'javaClass", "services.Item"), ("'name", "Pineapple"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(1.55)))
+  )
 

Added: tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/shopping-cart.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/shopping-cart.py?rev=980009&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/shopping-cart.py (added)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/shopping-cart.py Wed Jul 28 09:50:12 2010
@@ -0,0 +1,75 @@
+#  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.
+
+# Shopping cart implementation
+import uuid
+import sys
+
+cartId = "1234"
+
+# Get the shopping cart from the cache
+# Return an empty cart if not found
+def getcart(id, cache):
+    cart = cache("get", (id,))
+    if cart is None:
+        return ()
+    return cart
+
+# Post a new item to the cart, create a new cart if necessary
+def post(collection, item, cache):
+    id = str(uuid.uuid1())
+    cart = ((item[0], id, item[2]),) + getcart(cartId, cache)
+    cache("put", (cartId,), cart)
+    return (id,)
+
+
+# Find an item in the cart
+def find(id, cart):
+    if cart == ():
+        return ("Item", "0", ())
+    elif id == cart[0][1]:
+        return cart[0]
+    else:
+        return find(id, cart[1:])
+
+# Get items from the cart
+def get(id, cache):
+    if id == ():
+        return ("Your Cart", cartId) + getcart(cartId, cache)
+    return find(id[0], getcart(cartId, cache))
+
+# Delete items from the  cart
+def delete(id, cache):
+    if id == ():
+        return cache("delete", (cartId,))
+    return True
+
+# Return the price of an item
+def price(item):
+    return float(filter(lambda x: x[0] == "'price", item[2])[0][1])
+
+# Sum the prices of a list of items
+def sum(items):
+    if items == ():
+        return 0
+    return price(items[0]) + sum(items[1:])
+
+# Return the total price of the items in the cart
+def gettotal(cache):
+    cart = getcart(cartId, cache)
+    return sum(cart)
+

Added: tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.composite?rev=980009&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.composite (added)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.composite Wed Jul 28 09:50:12 2010
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+  xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+  targetNamespace="http://store"
+  name="store">
+        
+    <component name="Store">
+        <t:implementation.python script="store.py"/>
+        <service name="Widget">
+            <t:binding.http uri="store"/>
+        </service>
+        <reference name="catalog" target="Catalog"/>
+        <reference name="shoppingCart" target="ShoppingCart/Cart"/>
+        <reference name="shoppingTotal" target="ShoppingCart/Total"/>
+    </component>
+    
+    <component name="Catalog">
+        <t:implementation.python script="fruits-catalog.py"/> 
+        <property name="currencyCode">USD</property>
+        <service name="Catalog">
+            <t:binding.jsonrpc uri="catalog"/>
+        </service>
+        <reference name="currencyConverter" target="CurrencyConverter"/>
+    </component> 
+     
+    <component name="ShoppingCart">
+        <t:implementation.python script="shopping-cart.py"/>
+        <service name="ShoppingCart">
+            <t:binding.atom uri="shoppingCart"/>
+        </service>        
+        <service name="Total">
+            <t:binding.jsonrpc uri="total"/>
+        </service>        
+        <reference name="cache" target="Cache"/>
+    </component>
+    
+    <component name="CurrencyConverter">
+        <t:implementation.python script="currency-converter.py"/>
+        <service name="CurrencyConverter">
+            <t:binding.jsonrpc uri="currencyConverter"/>
+        </service>        
+    </component>     
+
+    <component name="Cache">
+        <implementation.cpp path="../../../../components/cache" library="libmemcache"/>
+        <service name="Cache">
+            <t:binding.atom uri="cache"/>
+        </service>
+    </component>     
+
+</composite>

Copied: tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.py (from r978945, tuscany/sca-cpp/trunk/modules/server/server-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.py?p2=tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.py&p1=tuscany/sca-cpp/trunk/modules/server/server-conf&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/server-conf (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.py Wed Jul 28 09:50:12 2010
@@ -1,5 +1,3 @@
-#!/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
@@ -17,16 +15,26 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a server conf
-here=`readlink -f $0`; here=`dirname $here`
-root=`readlink -f $1`
-
-cat >>$root/conf/httpd.conf <<EOF
-# Support for SCA component wiring
-LoadModule mod_tuscany_wiring $here/libmod_tuscany_wiring.so
+# Store implementation
+
+def post(item, catalog, shoppingCart, shoppingTotal):
+    return shoppingCart("post", item)
+
+def getall(catalog, shoppingCart, shoppingTotal):
+    return shoppingCart("getall")
+
+def get(id, catalog, shoppingCart, shoppingTotal):
+    return shoppingCart("get", id)
+
+def getcatalog(catalog, shoppingCart, shoppingTotal):
+    return catalog("getcatalog")
+
+def gettotal(catalog, shoppingCart, shoppingTotal):
+    return shoppingCart("gettotal")
 
-# Serve HTTP binding JavaScript client code
-Alias /js/tuscany-ref.js $here/htdocs/js/tuscany-ref.js
+def deleteall(catalog, shoppingCart, shoppingTotal):
+    return shoppingCart("deleteall")
 
-EOF
+def delete(id, catalog, shoppingCart, shoppingTotal):
+    return shoppingCart("delete", id)
 

Copied: tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/currency-converter.py (from r978945, tuscany/sca-cpp/trunk/samples/store-python/redirect)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/currency-converter.py?p2=tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/currency-converter.py&p1=tuscany/sca-cpp/trunk/samples/store-python/redirect&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-python/redirect (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/currency-converter.py Wed Jul 28 09:50:12 2010
@@ -1,5 +1,3 @@
-#!/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
@@ -17,8 +15,15 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Redirect ports 80 and 443
-intf=$1
-../../ubuntu/ip-redirect 80 8090 $intf
-../../ubuntu/ip-redirect 443 8453 $intf
+# Currency converter implementation
+
+def convert(fr, to, amount):
+    if to == "EUR":
+        return amount * 0.70
+    return amount
+
+def symbol(currency):
+    if currency == "EUR":
+        return "E"
+    return "$"
 

Copied: tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/fruits-catalog.py (from r978945, tuscany/sca-cpp/trunk/modules/openid/start-test)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/fruits-catalog.py?p2=tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/fruits-catalog.py&p1=tuscany/sca-cpp/trunk/modules/openid/start-test&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/openid/start-test (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/fruits-catalog.py Wed Jul 28 09:50:12 2010
@@ -1,5 +1,3 @@
-#!/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
@@ -17,16 +15,16 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Setup
-../../modules/http/httpd-conf tmp localhost 8090 htdocs
-./openid-conf tmp localhost 8090 htdocs
-./openid-step2-conf tmp localhost 8090 htdocs
-../../modules/server/server-conf tmp
-../../modules/server/scheme-conf tmp
-cat >>tmp/conf/httpd.conf <<EOF
-SCAContribution `pwd`/
-SCAComposite openid.composite
-EOF
+# Catalog implementation
 
-../../modules/http/httpd-start tmp
+def getcatalog(converter, currencyCode):
+  code = currencyCode()
+  def convert(price):
+      return converter("convert", "USD", code, price)
+  symbol = converter("symbol", code)
+  return (
+    (("'javaClass", "services.Item"), ("'name", "Apple"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(2.99))),
+    (("'javaClass", "services.Item"), ("'name", "Orange"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(3.55))),
+    (("'javaClass", "services.Item"), ("'name", "Pear"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(1.55)))
+  )
 

Added: tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/shopping-cart.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/shopping-cart.py?rev=980009&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/shopping-cart.py (added)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/shopping-cart.py Wed Jul 28 09:50:12 2010
@@ -0,0 +1,75 @@
+#  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.
+
+# Shopping cart implementation
+import uuid
+import sys
+
+cartId = "1234"
+
+# Get the shopping cart from the cache
+# Return an empty cart if not found
+def getcart(id, cache):
+    cart = cache("get", (id,))
+    if cart is None:
+        return ()
+    return cart
+
+# Post a new item to the cart, create a new cart if necessary
+def post(collection, item, cache):
+    id = str(uuid.uuid1())
+    cart = ((item[0], id, item[2]),) + getcart(cartId, cache)
+    cache("put", (cartId,), cart)
+    return (id,)
+
+
+# Find an item in the cart
+def find(id, cart):
+    if cart == ():
+        return ("Item", "0", ())
+    elif id == cart[0][1]:
+        return cart[0]
+    else:
+        return find(id, cart[1:])
+
+# Get items from the cart
+def get(id, cache):
+    if id == ():
+        return ("Your Cart", cartId) + getcart(cartId, cache)
+    return find(id[0], getcart(cartId, cache))
+
+# Delete items from the  cart
+def delete(id, cache):
+    if id == ():
+        return cache("delete", (cartId,))
+    return True
+
+# Return the price of an item
+def price(item):
+    return float(filter(lambda x: x[0] == "'price", item[2])[0][1])
+
+# Sum the prices of a list of items
+def sum(items):
+    if items == ():
+        return 0
+    return price(items[0]) + sum(items[1:])
+
+# Return the total price of the items in the cart
+def gettotal(cache):
+    cart = getcart(cartId, cache)
+    return sum(cart)
+

Added: tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.composite?rev=980009&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.composite (added)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.composite Wed Jul 28 09:50:12 2010
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+  xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+  targetNamespace="http://store"
+  name="store">
+        
+    <component name="Store">
+        <t:implementation.python script="store.py"/>
+        <service name="Widget">
+            <t:binding.http uri="store"/>
+        </service>
+        <reference name="catalog" target="Catalog"/>
+        <reference name="shoppingCart" target="ShoppingCart/Cart"/>
+        <reference name="shoppingTotal" target="ShoppingCart/Total"/>
+    </component>
+    
+    <component name="Catalog">
+        <t:implementation.python script="fruits-catalog.py"/> 
+        <property name="currencyCode">USD</property>
+        <service name="Catalog">
+            <t:binding.jsonrpc uri="catalog"/>
+        </service>
+        <reference name="currencyConverter" target="CurrencyConverter"/>
+    </component> 
+     
+    <component name="ShoppingCart">
+        <t:implementation.python script="shopping-cart.py"/>
+        <service name="ShoppingCart">
+            <t:binding.atom uri="shoppingCart"/>
+        </service>        
+        <service name="Total">
+            <t:binding.jsonrpc uri="total"/>
+        </service>        
+        <reference name="cache" target="Cache"/>
+    </component>
+    
+    <component name="CurrencyConverter">
+        <t:implementation.python script="currency-converter.py"/>
+        <service name="CurrencyConverter">
+            <t:binding.jsonrpc uri="currencyConverter"/>
+        </service>        
+    </component>     
+
+    <component name="Cache">
+        <implementation.cpp path="../../../../components/cache" library="libmemcache"/>
+        <service name="Cache">
+            <t:binding.atom uri="cache"/>
+        </service>
+    </component>     
+
+</composite>

Copied: tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.py (from r978945, tuscany/sca-cpp/trunk/modules/server/server-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.py?p2=tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.py&p1=tuscany/sca-cpp/trunk/modules/server/server-conf&r1=978945&r2=980009&rev=980009&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/server-conf (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.py Wed Jul 28 09:50:12 2010
@@ -1,5 +1,3 @@
-#!/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
@@ -17,16 +15,26 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a server conf
-here=`readlink -f $0`; here=`dirname $here`
-root=`readlink -f $1`
-
-cat >>$root/conf/httpd.conf <<EOF
-# Support for SCA component wiring
-LoadModule mod_tuscany_wiring $here/libmod_tuscany_wiring.so
+# Store implementation
+
+def post(item, catalog, shoppingCart, shoppingTotal):
+    return shoppingCart("post", item)
+
+def getall(catalog, shoppingCart, shoppingTotal):
+    return shoppingCart("getall")
+
+def get(id, catalog, shoppingCart, shoppingTotal):
+    return shoppingCart("get", id)
+
+def getcatalog(catalog, shoppingCart, shoppingTotal):
+    return catalog("getcatalog")
+
+def gettotal(catalog, shoppingCart, shoppingTotal):
+    return shoppingCart("gettotal")
 
-# Serve HTTP binding JavaScript client code
-Alias /js/tuscany-ref.js $here/htdocs/js/tuscany-ref.js
+def deleteall(catalog, shoppingCart, shoppingTotal):
+    return shoppingCart("deleteall")
 
-EOF
+def delete(id, catalog, shoppingCart, shoppingTotal):
+    return shoppingCart("delete", id)
 

Added: tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html?rev=980009&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html (added)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html Wed Jul 28 09:50:12 2010
@@ -0,0 +1,157 @@
+<!--
+    * 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.    
+-->
+<html>
+<head>
+<title>Store</title>
+
+<script type="text/javascript" src="/js/tuscany-ref.js"></script>
+
+<script type="text/javascript">
+var component = new tuscany.sca.Component("Store");
+
+//@Reference
+var catalog = new tuscany.sca.Reference("catalog");
+
+//@Reference
+var shoppingCart = new tuscany.sca.Reference("shoppingCart");
+
+//@Reference
+var shoppingTotal = new tuscany.sca.Reference("shoppingTotal");
+
+var catalogItems;
+
+function catalog_getcatalogResponse(items, exception) {
+    if (exception){
+        alert(exception.message);
+        return;
+    }
+    var catalog = "";
+    for (var i=0; i<items.length; i++) {
+        var item = items[i].name + ' - ' + items[i].price;
+        catalog += '<input name="items" type="checkbox" value="' + 
+                    item + '">' + item + ' <br>';
+    }
+    document.getElementById('catalog').innerHTML=catalog;
+    catalogItems = items;
+
+}
+
+function shoppingCart_getResponse(feed) {
+    if (feed != null) {
+        var entries = feed.getElementsByTagName("entry"); 
+        var list = "";
+        for (var i=0; i<entries.length; i++) {
+            var content = entries[i].getElementsByTagName("content")[0];
+            var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
+            var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
+            list += name + ' - ' + price + ' <br>';
+        }
+        document.getElementById("shoppingCart").innerHTML = list;
+
+        shoppingTotal.apply("gettotal", shoppingTotal_gettotalResponse);
+    }
+}
+
+function shoppingTotal_gettotalResponse(total, exception) {
+    if (exception) { 
+        alert(exception.message); 
+        return;
+    }
+    document.getElementById('total').innerHTML = total;
+}
+
+function shoppingCart_postResponse(entry) {
+    shoppingCart.get("", shoppingCart_getResponse);
+}                
+
+function addToCart() {
+    var items  = document.catalogForm.items;
+    var j = 0;
+    for (var i=0; i<items.length; i++)
+        if (items[i].checked) {
+            var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' +
+            '<item>' +
+            '<javaClass>' + catalogItems[i].javaClass + '</javaClass>' +
+            '<name>' + catalogItems[i].name + '</name>' +
+            '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
+            '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
+            '<price>' + catalogItems[i].price + '</price>' +
+            '</item>' +
+            '</content></entry>';
+            shoppingCart.post(entry, shoppingCart_postResponse);
+            items[i].checked = false;
+        }
+}
+function checkoutCart() {
+    document.getElementById('store').innerHTML='<h2>' +
+            'Thanks for Shopping With Us!</h2>'+
+            '<h2>Your Order</h2>'+
+            '<form name="orderForm">'+
+                document.getElementById('shoppingCart').innerHTML+
+                '<br>'+
+                document.getElementById('total').innerHTML+
+                '<br>'+
+                '<br>'+
+                '<input type="submit" value="Continue Shopping">'+ 
+            '</form>';
+    shoppingCart.del("", null);
+}
+function deleteCart() {
+    shoppingCart.del("", null);
+    document.getElementById('shoppingCart').innerHTML = "";
+    document.getElementById('total').innerHTML = "";    
+}
+
+function init() {
+    try {
+        catalog.apply("getcatalog", catalog_getcatalogResponse);
+        shoppingCart.get("", shoppingCart_getResponse);
+    } catch(e){
+        alert(e);
+    }
+}
+</script>
+
+</head>
+
+<body onload="init()">
+<h1>Jane's Store</h1>
+<div id="store">
+<h2>Catalog</h2>
+<form name="catalogForm">
+<div id="catalog" ></div>
+<br>
+<input type="button" onClick="addToCart()"  value="Add to Cart">
+</form>
+<br>
+  
+<h2>Your Shopping Cart</h2>
+<form name="shoppingCartForm">
+<div id="shoppingCart"></div>
+<br>
+<div id="total"></div>
+<br>        
+<input type="button" onClick="checkoutCart()" value="Checkout"> 
+<input type="button" onClick="deleteCart()" value="Empty">     
+<a href="shoppingCart/">(feed)</a>
+</form>    
+</div>
+
+</body>
+</html>

Added: tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html?rev=980009&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html (added)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html Wed Jul 28 09:50:12 2010
@@ -0,0 +1,157 @@
+<!--
+    * 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.    
+-->
+<html>
+<head>
+<title>Store</title>
+
+<script type="text/javascript" src="/js/tuscany-ref.js"></script>
+
+<script type="text/javascript">
+var component = new tuscany.sca.Component("Store");
+
+//@Reference
+var catalog = new tuscany.sca.Reference("catalog");
+
+//@Reference
+var shoppingCart = new tuscany.sca.Reference("shoppingCart");
+
+//@Reference
+var shoppingTotal = new tuscany.sca.Reference("shoppingTotal");
+
+var catalogItems;
+
+function catalog_getcatalogResponse(items, exception) {
+    if (exception){
+        alert(exception.message);
+        return;
+    }
+    var catalog = "";
+    for (var i=0; i<items.length; i++) {
+        var item = items[i].name + ' - ' + items[i].price;
+        catalog += '<input name="items" type="checkbox" value="' + 
+                    item + '">' + item + ' <br>';
+    }
+    document.getElementById('catalog').innerHTML=catalog;
+    catalogItems = items;
+
+}
+
+function shoppingCart_getResponse(feed) {
+    if (feed != null) {
+        var entries = feed.getElementsByTagName("entry"); 
+        var list = "";
+        for (var i=0; i<entries.length; i++) {
+            var content = entries[i].getElementsByTagName("content")[0];
+            var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
+            var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
+            list += name + ' - ' + price + ' <br>';
+        }
+        document.getElementById("shoppingCart").innerHTML = list;
+
+        shoppingTotal.apply("gettotal", shoppingTotal_gettotalResponse);
+    }
+}
+
+function shoppingTotal_gettotalResponse(total, exception) {
+    if (exception) { 
+        alert(exception.message); 
+        return;
+    }
+    document.getElementById('total').innerHTML = total;
+}
+
+function shoppingCart_postResponse(entry) {
+    shoppingCart.get("", shoppingCart_getResponse);
+}                
+
+function addToCart() {
+    var items  = document.catalogForm.items;
+    var j = 0;
+    for (var i=0; i<items.length; i++)
+        if (items[i].checked) {
+            var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' +
+            '<item>' +
+            '<javaClass>' + catalogItems[i].javaClass + '</javaClass>' +
+            '<name>' + catalogItems[i].name + '</name>' +
+            '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
+            '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
+            '<price>' + catalogItems[i].price + '</price>' +
+            '</item>' +
+            '</content></entry>';
+            shoppingCart.post(entry, shoppingCart_postResponse);
+            items[i].checked = false;
+        }
+}
+function checkoutCart() {
+    document.getElementById('store').innerHTML='<h2>' +
+            'Thanks for Shopping With Us!</h2>'+
+            '<h2>Your Order</h2>'+
+            '<form name="orderForm">'+
+                document.getElementById('shoppingCart').innerHTML+
+                '<br>'+
+                document.getElementById('total').innerHTML+
+                '<br>'+
+                '<br>'+
+                '<input type="submit" value="Continue Shopping">'+ 
+            '</form>';
+    shoppingCart.del("", null);
+}
+function deleteCart() {
+    shoppingCart.del("", null);
+    document.getElementById('shoppingCart').innerHTML = "";
+    document.getElementById('total').innerHTML = "";    
+}
+
+function init() {
+    try {
+        catalog.apply("getcatalog", catalog_getcatalogResponse);
+        shoppingCart.get("", shoppingCart_getResponse);
+    } catch(e){
+        alert(e);
+    }
+}
+</script>
+
+</head>
+
+<body onload="init()">
+<h1>Joe's Store</h1>
+<div id="store">
+<h2>Catalog</h2>
+<form name="catalogForm">
+<div id="catalog" ></div>
+<br>
+<input type="button" onClick="addToCart()"  value="Add to Cart">
+</form>
+<br>
+  
+<h2>Your Shopping Cart</h2>
+<form name="shoppingCartForm">
+<div id="shoppingCart"></div>
+<br>
+<div id="total"></div>
+<br>        
+<input type="button" onClick="checkoutCart()" value="Checkout"> 
+<input type="button" onClick="deleteCart()" value="Empty">     
+<a href="shoppingCart/">(feed)</a>
+</form>    
+</div>
+
+</body>
+</html>

Added: tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/index.html?rev=980009&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/index.html (added)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/index.html Wed Jul 28 09:50:12 2010
@@ -0,0 +1,34 @@
+<!--
+    * 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.    
+-->
+<html>
+<head>
+<title>Store</title>
+</head>
+
+<body>
+<h1>Store</h1>
+<p>For this sample to work, add the sample domain to your /etc/hosts as follows:<br/>
+127.0.0.1 sca-store.com jane.sca-store.com joe.sca-store.com</p>
+
+<p/>
+<p>Jane's store at <a href="http://jane.sca-store.com/">jane.sca-store.com</a>
+<br/>Joe's store at <a href="http://joe.sca-store.com/">joe.sca-store.com</a></p>
+
+</body>
+</html>

Added: tuscany/sca-cpp/trunk/samples/store-cluster/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/server-test?rev=980009&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/server-test (added)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/server-test Wed Jul 28 09:50:12 2010
@@ -0,0 +1,62 @@
+#!/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.
+
+echo "Testing..."
+here=`readlink -f $0`; here=`dirname $here`
+curl_prefix=`cat $here/../../modules/http/curl.prefix`
+
+# Setup
+./start
+sleep 2
+
+# For this test to work, add the test domain to your etc/hosts as follows:
+# 127.0.0.1 sca-store.com joe.sca-store.com joe.sca-store.com
+# then run ../../ubuntu/ip-redirect-all 80 8091
+
+# Test HTTP GET
+$curl_prefix/bin/curl http://joe.sca-store.com/ 2>/dev/null >tmp/index.html
+diff tmp/index.html htdocs/domains/joe/index.html
+rc=$?
+
+# Test Catalog
+if [ "$rc" = "0" ]; then
+    $curl_prefix/bin/curl http://joe.sca-store.com/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/getcatalog-request.txt >tmp/getcatalog-result.txt 2>/dev/null
+    diff tmp/getcatalog-result.txt ../store-cpp/htdocs/test/getcatalog-result.txt
+    rc=$?
+fi
+
+# Test Shopping Cart
+if [ "$rc" = "0" ]; then
+    $curl_prefix/bin/curl http://joe.sca-store.com/references/Store/shoppingCart -X POST -H "Content-type: application/atom+xml" --data @../store-cpp/htdocs/test/shopping-cart-entry.xml 2>/dev/null
+    rc=$?
+fi
+if [ "$rc" = "0" ]; then
+    $curl_prefix/bin/curl http://joe.sca-store.com/references/Store/shoppingCart >tmp/shopping-cart-feed.xml 2>/dev/null
+    grep "3.55" tmp/shopping-cart-feed.xml >/dev/null
+    rc=$?
+fi
+
+# Cleanup
+./stop
+sleep 2
+
+if [ "$rc" = "0" ]; then
+    echo "OK"
+fi
+return $rc

Propchange: tuscany/sca-cpp/trunk/samples/store-cluster/server-test
------------------------------------------------------------------------------
    svn:executable = *

Added: tuscany/sca-cpp/trunk/samples/store-cluster/ssl-start
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/ssl-start?rev=980009&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/ssl-start (added)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/ssl-start Wed Jul 28 09:50:12 2010
@@ -0,0 +1,113 @@
+#!/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 SSL certificates
+../../modules/http/ssl-ca-conf tmp/ssl sca-store.com
+../../modules/http/ssl-cert-conf tmp/ssl sca-store.com server
+../../modules/http/ssl-cert-conf tmp/ssl *.sca-store.com vhost
+
+# Start three identical app servers
+../../modules/http/httpd-conf tmp/server1 sca-store.com 8101/80 htdocs
+../../modules/http/vhost-conf tmp/server1
+cp `../../modules/http/ssl-ls tmp/ssl` tmp/server1/conf
+../../modules/http/httpd-ssl-conf tmp/server1 8441/443
+../../modules/http/vhost-ssl-conf tmp/server1
+../../modules/server/server-conf tmp/server1
+../../modules/python/python-conf tmp/server1
+cat >>tmp/server1/conf/httpd.conf <<EOF
+# Configure SCA Composite for mass dynamic virtual hosting
+SCAVirtualContribution `pwd`/domains/
+SCAVirtualComposite store.composite
+
+EOF
+../../modules/http/httpd-start tmp/server1
+
+../../modules/http/httpd-conf tmp/server2 sca-store.com 8102/80 htdocs
+../../modules/http/vhost-conf tmp/server2
+cp `../../modules/http/ssl-ls tmp/ssl` tmp/server2/conf
+../../modules/http/httpd-ssl-conf tmp/server2 8442/443
+../../modules/http/vhost-ssl-conf tmp/server2
+../../modules/server/server-conf tmp/server2
+../../modules/python/python-conf tmp/server2
+cat >>tmp/server2/conf/httpd.conf <<EOF
+# Configure SCA Composite for mass dynamic virtual hosting
+SCAVirtualContribution `pwd`/domains/
+SCAVirtualComposite store.composite
+
+EOF
+../../modules/http/httpd-start tmp/server2
+
+../../modules/http/httpd-conf tmp/server3 sca-store.com 8103/80 htdocs
+../../modules/http/vhost-conf tmp/server3
+cp `../../modules/http/ssl-ls tmp/ssl` tmp/server3/conf
+../../modules/http/httpd-ssl-conf tmp/server3 8443/443
+../../modules/http/vhost-ssl-conf tmp/server3
+../../modules/server/server-conf tmp/server3
+../../modules/python/python-conf tmp/server3
+cat >>tmp/server3/conf/httpd.conf <<EOF
+# Configure SCA Composite for mass dynamic virtual hosting
+SCAVirtualContribution `pwd`/domains/
+SCAVirtualComposite store.composite
+
+EOF
+../../modules/http/httpd-start tmp/server3
+
+# Start two identical proxy balancers
+../../modules/http/httpd-conf tmp/proxy1 sca-store.com 8091/80 tmp/proxy1/htdocs
+../../modules/http/vhost-conf tmp/proxy1
+../../modules/http/proxy-conf tmp/proxy1 sca-store.com 8091/80 tmp/proxy1/htdocs
+cp `../../modules/http/ssl-ls tmp/ssl` tmp/proxy1/conf
+../../modules/http/httpd-ssl-conf tmp/proxy1 8093/443
+../../modules/http/vhost-ssl-conf tmp/proxy1
+../../modules/http/proxy-ssl-conf tmp/proxy1
+../../modules/http/proxy-member-conf tmp/proxy1 localhost 8101
+../../modules/http/proxy-ssl-member-conf tmp/proxy1 localhost 8441
+../../modules/http/proxy-member-conf tmp/proxy1 localhost 8102
+../../modules/http/proxy-ssl-member-conf tmp/proxy1 localhost 8442
+../../modules/http/proxy-member-conf tmp/proxy1 localhost 8103
+../../modules/http/proxy-ssl-member-conf tmp/proxy1 localhost 8443
+../../modules/http/httpd-start tmp/proxy1
+
+../../modules/http/httpd-conf tmp/proxy2 sca-store.com 8092/80 tmp/proxy2/htdocs
+../../modules/http/vhost-conf tmp/proxy2
+../../modules/http/proxy-conf tmp/proxy2 sca-store.com 8092/80 tmp/proxy2/htdocs
+cp `../../modules/http/ssl-ls tmp/ssl` tmp/proxy2/conf
+../../modules/http/httpd-ssl-conf tmp/proxy2 8094/443
+../../modules/http/vhost-ssl-conf tmp/proxy2
+../../modules/http/proxy-ssl-conf tmp/proxy2
+../../modules/http/proxy-member-conf tmp/proxy2 localhost 8101
+../../modules/http/proxy-ssl-member-conf tmp/proxy2 localhost 8441
+../../modules/http/proxy-member-conf tmp/proxy2 localhost 8102
+../../modules/http/proxy-ssl-member-conf tmp/proxy2 localhost 8442
+../../modules/http/proxy-member-conf tmp/proxy2 localhost 8103
+../../modules/http/proxy-ssl-member-conf tmp/proxy2 localhost 8443
+../../modules/http/httpd-start tmp/proxy2
+
+# Start a shared memcached
+# Todo change to one per server
+../../components/cache/memcached-start
+
+# Redirect traffic from port 80 to 8091 and use proxy1
+#../../ubuntu/ip-redirect-all 80 8091
+#../../ubuntu/ip-redirect-all 443 8093
+
+# Redirect traffic from port 80 to 8092 and use proxy2
+#../../ubuntu/ip-redirect-all 80 8092
+#../../ubuntu/ip-redirect-all 443 8094
+

Propchange: tuscany/sca-cpp/trunk/samples/store-cluster/ssl-start
------------------------------------------------------------------------------
    svn:executable = *