diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-07-28 09:50:12 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-07-28 09:50:12 +0000 |
commit | fe93d86e5572870b2e4004c7788da8320a28de3d (patch) | |
tree | 95d45d6e22dd51af2b9fe0db5231f592b1396913 /sca-cpp/trunk/modules/server | |
parent | 73d5d5ee4452d4eb44938a1a0556a4312e94e135 (diff) |
Refactor and cleanup some of the config scripts. Add a sample using mod_proxy_balancer to distribute requests across three servers.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@980009 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/server')
-rwxr-xr-x | sca-cpp/trunk/modules/server/cpp-conf | 1 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/server/mod-eval.hpp | 6 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/server/scheme-conf | 1 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/server/server-conf | 51 |
4 files changed, 56 insertions, 3 deletions
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 + |