From f82576588fc9672a011655e709179eb43e5ab5b4 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 16 Jul 2012 06:47:37 +0000 Subject: Improve caching support and some of the navigations in the hosting environment. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1361914 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/.gitignore | 1 + .../trunk/hosting/server/htdocs/account/index.html | 40 ++-- .../hosting/server/htdocs/app/cache-manifest.cmf | 17 -- .../hosting/server/htdocs/app/cache-template.cmf | 17 ++ sca-cpp/trunk/hosting/server/htdocs/app/index.html | 55 +++-- .../trunk/hosting/server/htdocs/cache-manifest.cmf | 18 -- .../trunk/hosting/server/htdocs/cache-template.cmf | 18 ++ .../trunk/hosting/server/htdocs/clone/index.html | 36 ++- sca-cpp/trunk/hosting/server/htdocs/config.js | 32 ++- .../trunk/hosting/server/htdocs/create/index.html | 25 +- .../trunk/hosting/server/htdocs/delete/index.html | 32 ++- .../trunk/hosting/server/htdocs/graph/index.html | 43 ++-- .../trunk/hosting/server/htdocs/home/index.html | 21 +- sca-cpp/trunk/hosting/server/htdocs/index.html | 261 +++++++++++++-------- .../trunk/hosting/server/htdocs/login/index.html | 169 +++++++++---- .../trunk/hosting/server/htdocs/page/index.html | 38 ++- .../server/htdocs/proxy/public/oops/index.html | 64 +++-- .../trunk/hosting/server/htdocs/public/config.js | 22 +- .../server/htdocs/public/notauth/index.html | 66 ++++-- .../server/htdocs/public/notfound/index.html | 64 +++-- .../hosting/server/htdocs/public/notyet/index.html | 64 +++-- .../hosting/server/htdocs/public/oops/index.html | 64 +++-- .../trunk/hosting/server/htdocs/stats/index.html | 32 ++- .../trunk/hosting/server/htdocs/store/index.html | 85 ++++--- sca-cpp/trunk/hosting/server/logic-test | 28 +++ sca-cpp/trunk/hosting/server/proxy-start | 164 +++++++++++++ sca-cpp/trunk/hosting/server/server-test | 13 +- sca-cpp/trunk/hosting/server/ssl-proxy-start | 252 ++++++++++++++++++++ sca-cpp/trunk/hosting/server/start | 25 +- sca-cpp/trunk/hosting/server/stop | 1 + sca-cpp/trunk/modules/http/Makefile.am | 2 +- sca-cpp/trunk/modules/http/alt-host-conf | 32 +++ sca-cpp/trunk/modules/http/cache-conf | 41 ++++ sca-cpp/trunk/modules/http/cache-manifest | 26 ++ sca-cpp/trunk/modules/http/cache-ssl-conf | 41 ++++ sca-cpp/trunk/modules/http/htdocs/index.html | 2 +- sca-cpp/trunk/modules/http/htdocs/login/index.html | 4 +- .../trunk/modules/http/htdocs/logout/index.html | 4 +- sca-cpp/trunk/modules/http/httpd-conf | 37 ++- sca-cpp/trunk/modules/http/httpd.hpp | 30 ++- sca-cpp/trunk/modules/http/mass-host-conf | 62 +++++ sca-cpp/trunk/modules/http/mass-host-ssl-conf | 68 ++++++ sca-cpp/trunk/modules/http/vhost-conf | 62 ----- sca-cpp/trunk/modules/http/vhost-ssl-conf | 65 ----- sca-cpp/trunk/modules/js/htdocs/ui.css | 86 ++++++- sca-cpp/trunk/modules/js/htdocs/ui.js | 75 +++--- sca-cpp/trunk/modules/js/js-conf | 20 -- sca-cpp/trunk/modules/oauth/htdocs/index.html | 4 +- .../trunk/modules/oauth/htdocs/login/index.html | 2 +- .../trunk/modules/oauth/htdocs/login/mixed.html | 2 +- .../trunk/modules/oauth/htdocs/logout/index.html | 2 +- .../trunk/modules/oauth/htdocs/public/index.html | 2 +- sca-cpp/trunk/modules/openid/htdocs/index.html | 4 +- .../trunk/modules/openid/htdocs/login/index.html | 2 +- .../trunk/modules/openid/htdocs/logout/index.html | 2 +- .../trunk/modules/openid/htdocs/public/index.html | 2 +- sca-cpp/trunk/modules/server/htdocs/index.html | 2 +- sca-cpp/trunk/modules/wsgi/htdocs/index.html | 2 +- sca-cpp/trunk/samples/relay-gae/htdocs/index.html | 2 +- .../trunk/samples/relay-python/htdocs/index.html | 2 +- .../store-cluster/domains/jane/htdocs/index.html | 4 +- .../domains/jane/htdocs/login/index.html | 4 +- .../domains/jane/htdocs/logout/index.html | 4 +- .../store-cluster/domains/joe/htdocs/index.html | 4 +- .../domains/joe/htdocs/login/index.html | 4 +- .../domains/joe/htdocs/logout/index.html | 4 +- .../trunk/samples/store-cluster/htdocs/index.html | 2 +- .../samples/store-cluster/htdocs/login/index.html | 4 +- .../samples/store-cluster/htdocs/logout/index.html | 4 +- sca-cpp/trunk/samples/store-cluster/proxy-conf | 2 +- sca-cpp/trunk/samples/store-cluster/proxy-ssl-conf | 5 +- sca-cpp/trunk/samples/store-cluster/server-conf | 2 +- .../trunk/samples/store-cluster/server-ssl-conf | 5 +- .../trunk/samples/store-constdb/htdocs/index.html | 4 +- sca-cpp/trunk/samples/store-cpp/htdocs/index.html | 4 +- sca-cpp/trunk/samples/store-gae/htdocs/index.html | 4 +- sca-cpp/trunk/samples/store-java/htdocs/index.html | 4 +- .../trunk/samples/store-python/htdocs/index.html | 4 +- .../samples/store-python/htdocs/login/index.html | 4 +- .../samples/store-python/htdocs/logout/index.html | 4 +- .../trunk/samples/store-scheme/htdocs/index.html | 4 +- sca-cpp/trunk/samples/store-sql/htdocs/index.html | 4 +- .../store-vhost/domains/jane/htdocs/index.html | 4 +- .../store-vhost/domains/joe/htdocs/index.html | 4 +- .../trunk/samples/store-vhost/htdocs/index.html | 2 +- sca-cpp/trunk/samples/store-vhost/ssl-start | 4 +- sca-cpp/trunk/samples/store-vhost/start | 2 +- sca-cpp/trunk/samples/store-vhost/uec2-start | 4 +- 88 files changed, 1831 insertions(+), 727 deletions(-) delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/app/cache-manifest.cmf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/app/cache-template.cmf delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/cache-manifest.cmf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/cache-template.cmf create mode 100755 sca-cpp/trunk/hosting/server/logic-test create mode 100755 sca-cpp/trunk/hosting/server/proxy-start create mode 100755 sca-cpp/trunk/hosting/server/ssl-proxy-start create mode 100755 sca-cpp/trunk/modules/http/alt-host-conf create mode 100755 sca-cpp/trunk/modules/http/cache-conf create mode 100755 sca-cpp/trunk/modules/http/cache-manifest create mode 100755 sca-cpp/trunk/modules/http/cache-ssl-conf create mode 100755 sca-cpp/trunk/modules/http/mass-host-conf create mode 100755 sca-cpp/trunk/modules/http/mass-host-ssl-conf delete mode 100755 sca-cpp/trunk/modules/http/vhost-conf delete mode 100755 sca-cpp/trunk/modules/http/vhost-ssl-conf (limited to 'sca-cpp') diff --git a/sca-cpp/trunk/.gitignore b/sca-cpp/trunk/.gitignore index af24acaaa7..539b8309ac 100644 --- a/sca-cpp/trunk/.gitignore +++ b/sca-cpp/trunk/.gitignore @@ -57,6 +57,7 @@ config.guess config.sub config.status all.js +cache-manifest.cmf *-min.html *-min.js *-min.css diff --git a/sca-cpp/trunk/hosting/server/htdocs/account/index.html b/sca-cpp/trunk/hosting/server/htdocs/account/index.html index dce34d2ef3..a0c2e78c31 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/account/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/account/index.html @@ -27,7 +27,7 @@ Name: -Description: +About Me: @@ -70,17 +70,24 @@ diff --git a/sca-cpp/trunk/hosting/server/htdocs/app/cache-manifest.cmf b/sca-cpp/trunk/hosting/server/htdocs/app/cache-manifest.cmf deleted file mode 100644 index 6ea53970aa..0000000000 --- a/sca-cpp/trunk/hosting/server/htdocs/app/cache-manifest.cmf +++ /dev/null @@ -1,17 +0,0 @@ -CACHE MANIFEST - -# Version 5 - -# App resources -/favicon.ico -/public/iframe-min.html -/public/img.png -/public/notauth/ -/public/notfound/ -/public/notyet/ -/public/oops/ -/public/touchicon.png - -NETWORK: -* - diff --git a/sca-cpp/trunk/hosting/server/htdocs/app/cache-template.cmf b/sca-cpp/trunk/hosting/server/htdocs/app/cache-template.cmf new file mode 100644 index 0000000000..5881cf83dd --- /dev/null +++ b/sca-cpp/trunk/hosting/server/htdocs/app/cache-template.cmf @@ -0,0 +1,17 @@ +CACHE MANIFEST + +# Version SHA1 + +# App resources +/favicon.ico +/public/iframe-min.html +/public/img.png +/public/notauth/ +/public/notfound/ +/public/notyet/ +/public/oops/ +/public/touchicon.png + +NETWORK: +* + diff --git a/sca-cpp/trunk/hosting/server/htdocs/app/index.html b/sca-cpp/trunk/hosting/server/htdocs/app/index.html index 30bd1d9999..cddf4fb477 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/app/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/app/index.html @@ -26,6 +26,7 @@ +/** + * Load Javascript and CSS. + */ +(function() { - - +
@@ -102,13 +113,16 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/config-min.js')));
diff --git a/sca-cpp/trunk/hosting/server/htdocs/cache-manifest.cmf b/sca-cpp/trunk/hosting/server/htdocs/cache-manifest.cmf deleted file mode 100644 index e2c44def89..0000000000 --- a/sca-cpp/trunk/hosting/server/htdocs/cache-manifest.cmf +++ /dev/null @@ -1,18 +0,0 @@ -CACHE MANIFEST - -# Version 6 - -# App resources -/ -/favicon.ico -/public/iframe-min.html -/public/img.png -/public/notauth/ -/public/notfound/ -/public/notyet/ -/public/oops/ -/public/touchicon.png - -NETWORK: -* - diff --git a/sca-cpp/trunk/hosting/server/htdocs/cache-template.cmf b/sca-cpp/trunk/hosting/server/htdocs/cache-template.cmf new file mode 100644 index 0000000000..8d9aa26f7d --- /dev/null +++ b/sca-cpp/trunk/hosting/server/htdocs/cache-template.cmf @@ -0,0 +1,18 @@ +CACHE MANIFEST + +# Version SHA1 + +# App resources +/ +/favicon.ico +/public/iframe-min.html +/public/img.png +/public/notauth/ +/public/notfound/ +/public/notyet/ +/public/oops/ +/public/touchicon.png + +NETWORK: +* + diff --git a/sca-cpp/trunk/hosting/server/htdocs/clone/index.html b/sca-cpp/trunk/hosting/server/htdocs/clone/index.html index f5557efcd3..0a2f7733bc 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/clone/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/clone/index.html @@ -41,22 +41,31 @@
diff --git a/sca-cpp/trunk/hosting/server/htdocs/config.js b/sca-cpp/trunk/hosting/server/htdocs/config.js index de1d1410cd..70d3ea1195 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/config.js +++ b/sca-cpp/trunk/hosting/server/htdocs/config.js @@ -23,9 +23,31 @@ if (isNil(config)) /** * UI configuration. */ -config.windowtitle = 'App Builder' -config.pagetitle = 'App Builder'; -config.hometitle = '
Create SCA Composite Apps

'; -config.clone = 'Clone'; -config.logic = 'Logic'; +config.windowtitle = function() { + return 'App Builder'; +}; + +config.pagetitle = function() { + return 'App Builder'; +}; + +config.hometitle = function() { + return '
Create SCA Composite Apps

'; +}; + +config.clone = function() { + return 'Clone'; +}; + +config.logic = function() { + return 'Logic'; +}; + +config.viewfoot = function() { + return ui.menubar(mklist(ui.menu('menuabout', 'About', '/', '_view', 'note')), mklist()); +}; + +config.appresources = function() { + return mklist(); +}; diff --git a/sca-cpp/trunk/hosting/server/htdocs/create/index.html b/sca-cpp/trunk/hosting/server/htdocs/create/index.html index 825587627b..d8d2b30f3c 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/create/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/create/index.html @@ -41,17 +41,24 @@ diff --git a/sca-cpp/trunk/hosting/server/htdocs/delete/index.html b/sca-cpp/trunk/hosting/server/htdocs/delete/index.html index 75869a4f28..5a668af401 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/delete/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/delete/index.html @@ -43,20 +43,29 @@ diff --git a/sca-cpp/trunk/hosting/server/htdocs/graph/index.html b/sca-cpp/trunk/hosting/server/htdocs/graph/index.html index 6f73aec5ec..d360336375 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/graph/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/graph/index.html @@ -25,8 +25,11 @@ diff --git a/sca-cpp/trunk/hosting/server/htdocs/home/index.html b/sca-cpp/trunk/hosting/server/htdocs/home/index.html index 914eb1df00..130c05fda0 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/home/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/home/index.html @@ -37,17 +37,22 @@ diff --git a/sca-cpp/trunk/hosting/server/htdocs/index.html b/sca-cpp/trunk/hosting/server/htdocs/index.html index b46141919d..e3e046136d 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/index.html @@ -26,6 +26,7 @@ - - +
@@ -109,28 +128,45 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/config-min.js')));
+
+
+ +
diff --git a/sca-cpp/trunk/hosting/server/htdocs/login/index.html b/sca-cpp/trunk/hosting/server/htdocs/login/index.html index f9fa9f6f2f..bf09339927 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/login/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/login/index.html @@ -25,6 +25,7 @@ - +
@@ -96,22 +105,31 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/public/config-min.js'))
-
-

Sign in with your Facebook account

-

+
+ + + + + + +
+
+
-
-

Sign in with your Google account

-

+ + + + +
Sign in with your Facebook account
+
-
-

-

-

-

- + + + + +
Sign in with your Google account

@@ -129,30 +147,74 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/public/config-min.js'))
+
+
+ +
diff --git a/sca-cpp/trunk/hosting/server/htdocs/page/index.html b/sca-cpp/trunk/hosting/server/htdocs/page/index.html index 215383c76c..6a6e042c74 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/page/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/page/index.html @@ -71,8 +71,11 @@
diff --git a/sca-cpp/trunk/hosting/server/htdocs/proxy/public/oops/index.html b/sca-cpp/trunk/hosting/server/htdocs/proxy/public/oops/index.html index 9c795bf843..b1d118d59a 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/proxy/public/oops/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/proxy/public/oops/index.html @@ -25,6 +25,7 @@ - +
@@ -101,25 +110,35 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/proxy/public/config-min
+
+
+
diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/config.js b/sca-cpp/trunk/hosting/server/htdocs/public/config.js index 41a3bf6771..54818f4810 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/public/config.js +++ b/sca-cpp/trunk/hosting/server/htdocs/public/config.js @@ -23,7 +23,23 @@ if (isNil(config)) /** * UI configuration. */ -config.windowtitle = 'App Builder' -config.pagetitle = 'App Builder'; -config.loginprompt = 'Sign in with your userid and password'; +config.windowtitle = function() { + return 'App Builder'; +}; + +config.pagetitle = function() { + return 'App Builder'; +}; + +config.loginprompt = function() { + return 'Sign in with your userid and password'; +}; + +config.viewfoot = function() { + return ui.menubar(mklist(ui.menu('menuabout', 'About', '/', '_view', 'note')), mklist()); +}; + +config.appresources = function() { + return mklist(); +}; diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html index 959c6be327..89852393bf 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html @@ -25,6 +25,7 @@ - +
@@ -101,26 +110,36 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/public/config-min.js'))
+
+
+
diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html index f2e4f6695a..8f0d486854 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html @@ -25,6 +25,7 @@ - +
@@ -102,25 +111,35 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/public/config-min.js'))
+
+
+
diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/notyet/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/notyet/index.html index 24f738ec09..e43a992f38 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/public/notyet/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/public/notyet/index.html @@ -25,6 +25,7 @@ - +
@@ -102,25 +111,35 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/public/config-min.js'))
+
+
+
diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/oops/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/oops/index.html index ea190f4ec9..cc97c5362e 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/public/oops/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/public/oops/index.html @@ -25,6 +25,7 @@ - +
@@ -101,25 +110,35 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/public/config-min.js'))
+
+
+
diff --git a/sca-cpp/trunk/hosting/server/htdocs/stats/index.html b/sca-cpp/trunk/hosting/server/htdocs/stats/index.html index 1dd12de1f3..7c3d9a6434 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/stats/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/stats/index.html @@ -39,22 +39,31 @@
diff --git a/sca-cpp/trunk/hosting/server/htdocs/store/index.html b/sca-cpp/trunk/hosting/server/htdocs/store/index.html index 471229d9d5..1264007fe3 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/store/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/store/index.html @@ -22,43 +22,67 @@
diff --git a/sca-cpp/trunk/hosting/server/logic-test b/sca-cpp/trunk/hosting/server/logic-test new file mode 100755 index 0000000000..d4767e858f --- /dev/null +++ b/sca-cpp/trunk/hosting/server/logic-test @@ -0,0 +1,28 @@ +#!/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. + +# Run Python test cases +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +python_prefix=`cat $here/../../modules/python/python.prefix` +export LD_LIBRARY_PATH=$python_prefix/lib:$LD_LIBRARY_PATH + +$python_prefix/bin/python test.py 2>/dev/null +rc=$? + +exit $rc diff --git a/sca-cpp/trunk/hosting/server/proxy-start b/sca-cpp/trunk/hosting/server/proxy-start new file mode 100755 index 0000000000..f06de9fc01 --- /dev/null +++ b/sca-cpp/trunk/hosting/server/proxy-start @@ -0,0 +1,164 @@ +#!/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. + +# For this module to work, add the www.example.com domain to your /etc/hosts as +# follows: +# 127.0.0.1 www.example.com + +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` + +# Configure and start logging +if [ -x ../../components/log/scribe-cat ]; then + ../../components/log/scribed-central-conf tmp + ../../components/log/scribed-client-conf tmp localhost + ../../components/log/scribed-central-start tmp + ../../components/log/scribed-client-start tmp +fi + +# Start memcached +../../components/cache/memcached-start tmp 11211 +../../components/cache/memcached-start tmp 11212 + +# Configure server +../../modules/http/httpd-conf tmp www.example.com 9090 htdocs +../../modules/http/httpd-event-conf tmp + +# Configure Python component support +../../modules/server/server-conf tmp +../../modules/python/python-conf tmp + +# Configure server log streaming +if [ -x ../../components/log/scribe-cat ]; then + cat >tmp/conf/log.conf <>tmp/conf/svhost.conf <>tmp/conf/httpd.conf <>tmp/conf/httpd.conf <>tmp/conf/svhost.conf </ to htdocs/app/ +AliasMatch /v/([^/]+)(.*)$ $here/htdocs/app\$2 + +EOF + +# Start server +../../modules/http/httpd-start tmp + +# Clear document cache +rm -rf tmp/proxy/cache + +# Configure proxy balancer +../../modules/http/httpd-conf tmp/proxy www.example.com 8090 tmp/htdocs +../../modules/http/alt-host-conf tmp/proxy ww1.example.com +../../modules/http/alt-host-conf tmp/proxy ww2.example.com +../../modules/http/proxy-conf tmp/proxy +../../modules/js/js-conf tmp/proxy +../../modules/http/httpd-event-conf tmp/proxy +#../../modules/http/cache-conf tmp/proxy + +# Configure proxy balancer members +../../modules/http/proxy-member-conf tmp/proxy localhost 9090 + +# Configure proxy log streaming +if [ -x ../../components/log/scribe-cat ]; then + cat >tmp/proxy/conf/log.conf <>tmp/proxy/conf/httpd.conf <>tmp/proxy/conf/vhost.conf </dev/null +# Test +./client-test 2>/dev/null rc=$? +# Cleanup +./stop +sleep 2 exit $rc diff --git a/sca-cpp/trunk/hosting/server/ssl-proxy-start b/sca-cpp/trunk/hosting/server/ssl-proxy-start new file mode 100755 index 0000000000..e38f54055b --- /dev/null +++ b/sca-cpp/trunk/hosting/server/ssl-proxy-start @@ -0,0 +1,252 @@ +#!/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. + +# For this module to work, add the www.example.com domain to your /etc/hosts as +# follows: +# 127.0.0.1 www.example.com + +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` + +# Configure and start logging +if [ -x ../../components/log/scribe-cat ]; then + ../../components/log/scribed-central-conf tmp + ../../components/log/scribed-client-conf tmp localhost + ../../components/log/scribed-central-start tmp + ../../components/log/scribed-client-start tmp +fi + +# Start memcached +../../components/cache/memcached-start tmp 11211 +../../components/cache/memcached-start tmp 11212 + +# Configure server +../../modules/http/httpd-conf tmp www.example.com 9090 htdocs +../../modules/http/httpd-event-conf tmp + +# Configure HTTP basic auth +../../modules/http/basic-auth-conf tmp component + +# Configure OAuth authentication +# Configure your OAuth app keys here +../../modules/oauth/oauth-conf tmp component +../../modules/oauth/oauth-memcached-conf tmp localhost 11212 +../../modules/oauth/oauth2-appkey-conf tmp facebook.com 12345 67890 +../../modules/oauth/oauth2-appkey-conf tmp google.com 12345 67890 + +# Configure form-based authentication +../../modules/http/open-auth-conf tmp component 80b67f38-b79e-4a72-bb5c-22c69fb00820 + +# Configure authorized admins +../../modules/http/passwd-auth-conf tmp admin admin + +# Configure Python component support +../../modules/server/server-conf tmp +../../modules/python/python-conf tmp + +# Configure server log streaming +if [ -x ../../components/log/scribe-cat ]; then + cat >tmp/conf/log.conf <>tmp/conf/svhost.conf <>tmp/conf/httpd.conf <>tmp/conf/httpd.conf <>tmp/conf/svhost-ssl.conf </ to htdocs/app/ +AliasMatch /v/([^/]+)(.*)$ $here/htdocs/app\$2 + +EOF + +# Configure admin access to server status and info +cat >tmp/conf/adminauth.conf < +AuthType None +Require all granted + + + +AuthType None +Require all granted + + +EOF + +# Configure admin access to components +cat >>tmp/conf/locauth-ssl.conf < +Require user admin + + +Require user admin + + +Require valid-user + + +Require valid-user + +EOF + +# Start server +../../modules/http/httpd-start tmp +sleep 2 + +# Configure authorized users +./put-auth tmp admin admin admin admin +./put-auth tmp admin admin john john +./put-auth tmp admin admin jane jane +# Configure the email addresses associated with your OAuth ids here +./put-auth tmp admin admin /oauth1/john@example.com password +./put-auth tmp admin admin /oauth2/jane@example.com password + +# Clear document cache +rm -rf tmp/proxy/cache + +# Create SSL certificates +../../modules/http/ssl-ca-conf tmp/proxy www.example.com +../../modules/http/ssl-cert-conf tmp/proxy www.example.com server + +# Configure proxy balancer +../../modules/http/httpd-conf tmp/proxy www.example.com 8090 tmp/htdocs +../../modules/http/alt-host-conf tmp/proxy ww1.example.com +../../modules/http/alt-host-conf tmp/proxy ww2.example.com +../../modules/http/proxy-conf tmp/proxy +../../modules/js/js-conf tmp/proxy +../../modules/http/httpd-event-conf tmp/proxy +#../../modules/http/cache-conf tmp/proxy +../../modules/http/httpd-ssl-conf tmp/proxy 8453 +../../modules/http/proxy-ssl-conf tmp/proxy +#../../modules/http/cache-ssl-conf tmp/proxy + +# Configure password authentication +../../modules/http/basic-auth-conf tmp/proxy file /balancer-manager +../../modules/http/basic-auth-conf tmp/proxy file /server-status +../../modules/http/passwd-auth-conf tmp/proxy file admin admin + +# Configure mod-security +../../modules/http/mod-security-conf tmp/proxy +#../../modules/http/mod-security-audit-conf tmp/proxy + +# Configure proxy balancer members +../../modules/http/proxy-ssl-nossl-member-conf tmp/proxy localhost 9090 + +# Configure proxy log streaming +if [ -x ../../components/log/scribe-cat ]; then + cat >tmp/proxy/conf/log.conf <tmp/proxy/conf/log-ssl.conf <tmp/proxy/conf/mod-security-audit-log.conf <>tmp/proxy/conf/httpd.conf <>tmp/proxy/conf/vhost-ssl.conf <>tmp/conf/svhost.conf <>tmp/conf/svhost.conf <>tmp/conf/svhost.conf <>$root/conf/hostcond.conf <>$root/conf/vhost.conf <$root/cache-manifest.cmf + diff --git a/sca-cpp/trunk/modules/http/cache-ssl-conf b/sca-cpp/trunk/modules/http/cache-ssl-conf new file mode 100755 index 0000000000..7a902c37eb --- /dev/null +++ b/sca-cpp/trunk/modules/http/cache-ssl-conf @@ -0,0 +1,41 @@ +#!/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 cache configuration +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +mkdir -p $1 +root=`echo "import os; print os.path.realpath('$1')" | python` + +mkdir -p $root/cache + +cat >>$root/conf/vhost-ssl.conf < - + It works diff --git a/sca-cpp/trunk/modules/http/htdocs/login/index.html b/sca-cpp/trunk/modules/http/htdocs/login/index.html index 3936730553..fd3bc21889 100644 --- a/sca-cpp/trunk/modules/http/htdocs/login/index.html +++ b/sca-cpp/trunk/modules/http/htdocs/login/index.html @@ -22,8 +22,8 @@ - - + + Sign in diff --git a/sca-cpp/trunk/modules/http/htdocs/logout/index.html b/sca-cpp/trunk/modules/http/htdocs/logout/index.html index 66f2893a1f..218dd5d52c 100644 --- a/sca-cpp/trunk/modules/http/htdocs/logout/index.html +++ b/sca-cpp/trunk/modules/http/htdocs/logout/index.html @@ -23,8 +23,8 @@ - - + + Sign out

Sign out

diff --git a/sca-cpp/trunk/modules/http/httpd-conf b/sca-cpp/trunk/modules/http/httpd-conf index 54154e119e..730775fa89 100755 --- a/sca-cpp/trunk/modules/http/httpd-conf +++ b/sca-cpp/trunk/modules/http/httpd-conf @@ -22,8 +22,6 @@ here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $h mkdir -p $1 root=`echo "import os; print os.path.realpath('$1')" | python` -jsprefix=`echo "import os; print os.path.realpath('$here/../js')" | python` - host=$2 port=`$here/httpd-addr port $3` pport=`$here/httpd-addr pport $3` @@ -44,8 +42,10 @@ group=`id -gn` uname=`uname -s` if [ $uname = "Darwin" ]; then libsuffix=".dylib" + sendfile=Off else libsuffix=".so" + sendfile=On fi modules_prefix=`cat $here/httpd-modules.prefix` @@ -76,6 +76,8 @@ Timeout 45 RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500 LimitRequestBody 1048576 HostNameLookups Off +#MaxKeepAliveRequests 25 +#MaxConnectionsPerChild 100 # Log HTTP requests # [timestamp] [access] remote-host remote-ident remote-user "request-line" @@ -92,9 +94,13 @@ AddCharset utf-8 .html .js .css # Configure cache control ExpiresActive On -ExpiresDefault M604800 +ExpiresDefault A604800 +Header onsuccess merge Cache-Control public env=!private-cache +# Enable Linux Kernel sendfile +EnableSendFile $sendfile + # Configure auth modules Include conf/auth.conf @@ -133,7 +139,7 @@ ServerName http://$host$pportsuffix RewriteEngine on -RewriteCond %{HTTP_HOST} !^$host [NC] +Include conf/hostcond.conf RewriteCond %{HTTP:X-Forwarded-Server} ^$ [NC] RewriteCond %{REQUEST_URI} !^/server-status [NC] RewriteCond %{REQUEST_URI} !^/balancer-manager [NC] @@ -166,11 +172,16 @@ cat >$root/conf/mpm.conf <>$root/conf/mpm.conf <$root/conf/modules.conf <$root/conf/modules.conf <$root/conf/httpd.groups <$root/conf/noauth.conf <$root/conf/hostcond.conf < #include #include @@ -72,6 +73,7 @@ #include #include #include +} #include "string.hpp" #include "stream.hpp" @@ -153,6 +155,14 @@ const string hostName(request_rec* r, const string& def = "localhost") { return h != NULL? h : (r->server->server_hostname != NULL? r->server->server_hostname : def); } +/** + * Convert a host name to a realm. + */ +const string realm(const string& host) { + const string pre = substr(host, 0, 4); + return pre == "www." || pre == "ww1." || pre == "ww2." || pre == "ww3."? substr(host, 4) : host; +} + /** * Return the protocol scheme for a server. */ @@ -410,6 +420,7 @@ const failable writeResult(const failable >& ls, const string& // Make sure browsers come back and check for updated dynamic content apr_table_set(r->headers_out, "Cache-Control", "must-revalidate, max-age=0"); apr_table_set(r->headers_out, "Expires", "Tue, 01 Jan 1980 00:00:00 GMT"); + apr_table_set(r->subprocess_env, "private-cache", "1"); // Compute and return an Etag for the returned content const string etag(ap_md5_binary(r->pool, (const unsigned char*)c_str(ob), (int)length(ob))); @@ -474,9 +485,9 @@ const bool redirectFilters(ap_filter_t* f, request_rec* from, request_rec* to) { * Create an HTTPD internal redirect request. * Similar to httpd/modules/http/http_request.c::internal_internal_redirect. */ -const failable internalRedirectRequest(const string& nr_uri, request_rec* r) { +const failable internalRedirectRequest(const string& nr_uri, request_rec* r) { if (ap_is_recursion_limit_exceeded(r)) - return mkfailure(HTTP_INTERNAL_SERVER_ERROR); + return mkfailure("Redirect recursion limit exceeded", HTTP_INTERNAL_SERVER_ERROR); // Create a new request request_rec* nr = (request_rec*)apr_pcalloc(r->pool, sizeof(request_rec)); @@ -532,7 +543,7 @@ const failable internalRedirectRequest(const string& nr_uri, redirectFilters(nr->output_filters, r, nr); const int rrc = ap_run_post_read_request(nr); if (rrc != OK && rrc != DECLINED) - return mkfailure(rrc); + return mkfailure("Error handling internal redirect", rrc); return nr; } @@ -561,9 +572,9 @@ const int internalRedirect(request_rec* nr) { */ const int internalRedirect(const string& uri, request_rec* r) { debug(uri, "httpd::internalRedirect"); - const failable nr = httpd::internalRedirectRequest(uri, r); + const failable nr = httpd::internalRedirectRequest(uri, r); if (!hasContent(nr)) - return reason(nr); + return rcode(nr); return httpd::internalRedirect(content(nr)); } @@ -571,9 +582,9 @@ const int internalRedirect(const string& uri, request_rec* r) { * Create an HTTPD sub request. * Similar to httpd/server/request.c::make_sub_request */ -const failable internalSubRequest(const string& nr_uri, request_rec* r) { +const failable internalSubRequest(const string& nr_uri, request_rec* r) { if (ap_is_recursion_limit_exceeded(r)) - return mkfailure(HTTP_INTERNAL_SERVER_ERROR); + return mkfailure("Redirect recursion limit exceeded", HTTP_INTERNAL_SERVER_ERROR); // Create a new sub pool apr_pool_t *nrp; @@ -640,7 +651,8 @@ const int externalRedirect(const string& uri, request_rec* r) { debug(uri, "httpd::externalRedirect"); r->status = HTTP_MOVED_TEMPORARILY; apr_table_setn(r->headers_out, "Location", apr_pstrdup(r->pool, c_str(uri))); - apr_table_setn(r->headers_out, "Cache-Control", "no-cache"); + apr_table_setn(r->headers_out, "Cache-Control", "no-store"); + apr_table_addn(r->err_headers_out, "Cache-Control", "no-store"); r->filename = apr_pstrdup(r->pool, c_str(string("/redirect:/") + uri)); return HTTP_MOVED_TEMPORARILY; } @@ -705,7 +717,7 @@ int debugNote(unused void* r, const char* key, const char* value) { * Log a request. */ const bool debugRequest(request_rec* r, const string& msg) { - gc_scoped_pool(); + gc_scoped_pool pool; cdebug << msg << ":" << endl; cdebug << " unparsed uri: " << debugOptional(r->unparsed_uri) << endl; cdebug << " uri: " << debugOptional(r->uri) << endl; diff --git a/sca-cpp/trunk/modules/http/mass-host-conf b/sca-cpp/trunk/modules/http/mass-host-conf new file mode 100755 index 0000000000..2da8f4f836 --- /dev/null +++ b/sca-cpp/trunk/modules/http/mass-host-conf @@ -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. + +# Generate mass dynamic virtual hosting configuration +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +mkdir -p $1 +root=`echo "import os; print os.path.realpath('$1')" | python` + +vroot=`echo "import os; print os.path.realpath('$2')" | python` +vhtdocs=$3 + +conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` +host=`echo $conf | awk '{ print $6 }'` +addr=`echo $conf | awk '{ print $7 }'` +port=`$here/httpd-addr port $addr` +pport=`$here/httpd-addr pport $addr` +vhost=`$here/httpd-addr vhost $addr` + +htdocs=`echo $conf | awk '{ print $8 }'` +mkdir -p $htdocs +htdocs=`echo "import os; print os.path.realpath('$htdocs')" | python` + +cat >>$root/conf/httpd.conf < +ServerName http://vhost.$host:$pport +ServerAlias *.$host + +# Map /v// to vroot//vhtdocs/ +AliasMatch /v/([^/]+)(.*)$ $vroot/\$1/$vhtdocs/\$2 + +Include conf/dvhost.conf + +# Configure authentication +Include conf/noauth.conf +Include conf/locauth.conf +Include conf/pubauth.conf +Include conf/adminauth.conf + + + +EOF + diff --git a/sca-cpp/trunk/modules/http/mass-host-ssl-conf b/sca-cpp/trunk/modules/http/mass-host-ssl-conf new file mode 100755 index 0000000000..68bd5b4606 --- /dev/null +++ b/sca-cpp/trunk/modules/http/mass-host-ssl-conf @@ -0,0 +1,68 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Generate mass dynamic virtual hosting configuration +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +mkdir -p $1 +root=`echo "import os; print os.path.realpath('$1')" | python` + +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"` +ssladdr=`echo $sslconf | awk '{ print $6 }'` +sslport=`$here/httpd-addr port $ssladdr` +sslpport=`$here/httpd-addr pport $ssladdr` +sslvhost=`$here/httpd-addr vhost $ssladdr` + +vhostconf=`cat $root/conf/httpd.conf | grep "# Generated by: mass-host-conf"` +vroot=`echo $vhostconf | awk '{ print $6 }'`; vroot=`echo "import os; print os.path.realpath('$vroot')" | python` +vhtdocs=`echo $vhostconf | awk '{ print $7 }'` + +htdocs=`echo $conf | awk '{ print $8 }'` +mkdir -p $htdocs +htdocs=`echo "import os; print os.path.realpath('$htdocs')" | python` + +cat >>$root/conf/httpd.conf < +ServerName https://vhost.$host:$sslpport +ServerAlias *.$host + +# Map /v// to vroot//vhtdocs/ +AliasMatch /v/([^/]+)(.*)$ $vroot/\$1/$vhtdocs/\$2 + +Include conf/dvhost-ssl.conf + +# Configure authentication +Include conf/noauth-ssl.conf +Include conf/locauth-ssl.conf +Include conf/pubauth-ssl.conf +Include conf/adminauth-ssl.conf + +# Configure tracking +Include conf/tracking-ssl.conf + + + diff --git a/sca-cpp/trunk/modules/http/vhost-conf b/sca-cpp/trunk/modules/http/vhost-conf deleted file mode 100755 index 6d977eb1d5..0000000000 --- a/sca-cpp/trunk/modules/http/vhost-conf +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Generate mass dynamic virtual hosting configuration -here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` -mkdir -p $1 -root=`echo "import os; print os.path.realpath('$1')" | python` - -vroot=`echo "import os; print os.path.realpath('$2')" | python` -vhtdocs=$3 - -conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` -host=`echo $conf | awk '{ print $6 }'` -addr=`echo $conf | awk '{ print $7 }'` -port=`$here/httpd-addr port $addr` -pport=`$here/httpd-addr pport $addr` -vhost=`$here/httpd-addr vhost $addr` - -htdocs=`echo $conf | awk '{ print $8 }'` -mkdir -p $htdocs -htdocs=`echo "import os; print os.path.realpath('$htdocs')" | python` - -cat >>$root/conf/httpd.conf < -ServerName http://vhost.$host:$pport -ServerAlias *.$host - -# Map /v// to vroot//vhtdocs/ -AliasMatch /v/([^/]+)(.*)$ $vroot/\$1/$vhtdocs/\$2 - -Include conf/dvhost.conf - -# Configure authentication -Include conf/noauth.conf -Include conf/auth.conf -Include conf/pubauth.conf -Include conf/adminauth.conf - - - -EOF - diff --git a/sca-cpp/trunk/modules/http/vhost-ssl-conf b/sca-cpp/trunk/modules/http/vhost-ssl-conf deleted file mode 100755 index 915137b51f..0000000000 --- a/sca-cpp/trunk/modules/http/vhost-ssl-conf +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Generate mass dynamic virtual hosting configuration -here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` -mkdir -p $1 -root=`echo "import os; print os.path.realpath('$1')" | python` - -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"` -ssladdr=`echo $sslconf | awk '{ print $6 }'` -sslport=`$here/httpd-addr port $ssladdr` -sslpport=`$here/httpd-addr pport $ssladdr` -sslvhost=`$here/httpd-addr vhost $ssladdr` - -vhostconf=`cat $root/conf/httpd.conf | grep "# Generated by: vhost-conf"` -vroot=`echo $vhostconf | awk '{ print $6 }'`; vroot=`echo "import os; print os.path.realpath('$vroot')" | python` -vhtdocs=`echo $vhostconf | awk '{ print $7 }'` - -htdocs=`echo $conf | awk '{ print $8 }'` -mkdir -p $htdocs -htdocs=`echo "import os; print os.path.realpath('$htdocs')" | python` - -cat >>$root/conf/httpd.conf < -ServerName https://vhost.$host:$sslpport -ServerAlias *.$host - -# Map /v// to vroot//vhtdocs/ -AliasMatch /v/([^/]+)(.*)$ $vroot/\$1/$vhtdocs/\$2 - -Include conf/dvhost-ssl.conf - -# Configure authentication -Include conf/noauth-ssl.conf -Include conf/auth-ssl.conf -Include conf/pubauth-ssl.conf -Include conf/adminauth-ssl.conf - - - diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.css b/sca-cpp/trunk/modules/js/htdocs/ui.css index 3dde10a2c0..ddc21b2095 100644 --- a/sca-cpp/trunk/modules/js/htdocs/ui.css +++ b/sca-cpp/trunk/modules/js/htdocs/ui.css @@ -34,7 +34,7 @@ visibility: hidden; } .fixed { -position: absolute; +position: fixed; } .devicewidth { @@ -175,13 +175,95 @@ overflow: hidden; .viewheadbackground { position: absolute; left: 0px; top: 35px; height: 35px; line-height: 35px; width: 2500px; z-index: 7; -font-size: 110%; font-weight: bold; background-color: #f1f1f1; color: #000000; +background-color: #f1f1f1; border-top: 1px; border-bottom: 1px; border-left: 0px; border-right: 0px; border-style: solid; border-top-color: #e5e5e5; border-bottom-color: #e5e5e5; overflow: hidden; -webkit-backface-visibility: hidden; } +.viewfoot { +position: absolute; left: 0px; bottom: 0px; height: 25px; line-height: 25px; width: 100%; z-index: 8; +font-size: 12px; background-color: #ffffff; color: #404040; +border-top: 1px; border-bottom: 1px; border-left: 0px; border-right: 0px; +border-style: solid; border-top-color: #e5e5e5; border-bottom-color: #ffffff; +overflow: hidden; +-webkit-backface-visibility: hidden; +} + +.status { +position: absolute; left: 0px; bottom: 0px; height: 35px; line-height: 35px; width: 100%; z-index: 9; +font-size: 12px; background-color: #ffffff; color: #404040; +border-top: 0px; border-bottom: 0px; border-left: 0px; border-right: 0px; +border-style: solid; border-top-color: #e5e5e5; border-bottom-color: #ffffff; +overflow: hidden; +-webkit-transform: translate(0px, 0px); +-moz-transform: translate(0px, 0px); +-ms-transform: translate(0px, 0px); +-o-transform: translate(0px, 0px); +transform: translate(0px, 0px); +-webkit-backface-visibility: hidden; +} + +.statusout3 { +position: absolute; left: 0px; bottom: 0px; height: 35px; line-height: 35px; width: 100%; z-index: 9; +font-size: 12px; background-color: #ffffff; color: #404040; +border-top: 0px; border-bottom: 0px; border-left: 0px; border-right: 0px; +border-style: solid; border-top-color: #e5e5e5; border-bottom-color: #ffffff; +overflow: hidden; +-webkit-transition: -webkit-transform 0.4s ease-in-out 3s; +-moz-transition: -moz-transform 0.4s ease-in-out 3s; +-ms-transition: -ms-transform 0.4s ease-in-out 3s; +-o-transition: -o-transform 0.4s ease-in-out 3s; +transition: transform 0.4s ease-in-out 3s; +-webkit-transform: translate(0px, 35px); +-moz-transform: translate(0px, 35px); +-ms-transform: translate(0px, 35px); +-o-transform: translate(0px, 35px); +transform: translate(0px, 35px); +-webkit-backface-visibility: hidden; +} + +.statusout1 { +position: absolute; left: 0px; bottom: 0px; height: 35px; line-height: 35px; width: 100%; z-index: 9; +font-size: 12px; background-color: #ffffff; color: #404040; +border-top: 0px; border-bottom: 0px; border-left: 0px; border-right: 0px; +border-style: solid; border-top-color: #e5e5e5; border-bottom-color: #ffffff; +overflow: hidden; +-webkit-transition: -webkit-transform 0.4s ease-in-out 1s; +-moz-transition: -moz-transform 0.4s ease-in-out 1s; +-ms-transition: -ms-transform 0.4s ease-in-out 1s; +-o-transition: -o-transform 0.4s ease-in-out 1s; +transition: transform 0.4s ease-in-out 1s; +-webkit-transform: translate(0px, 35px); +-moz-transform: translate(0px, 35px); +-ms-transform: translate(0px, 35px); +-o-transform: translate(0px, 35px); +transform: translate(0px, 35px); +-webkit-backface-visibility: hidden; +} + +.okstatus { +font-size: 110%; font-weight: bold; padding-left: 6px; padding-right: 6px; white-space: nowrap; text-decoration: none; +background-color: #f1f1f1; color: #000000; +width: 100%; margin-left: auto; margin-right: auto; text-align: center; float: right; +} + +.errorstatus { +font-size: 110%; font-weight: bold; padding-left: 6px; padding-right: 6px; white-space: nowrap; text-decoration: none; +background-color: #d14836; color: #ffffff; +width: 100%; margin-left: auto; margin-right: auto; text-align: center; float: right; +} + +.viewfootbackground { +position: absolute; left: 0px; bottom: 0px; height: 25px; line-height: 25px; width: 2500px; z-index: 7; +background-color: #ffffff; +border-top: 1px; border-bottom: 1px; border-left: 0px; border-right: 0px; +border-style: solid; border-top-color: #e5e5e5; border-bottom-color: #ffffff; +overflow: hidden; +-webkit-backface-visibility: hidden; +} + .viewcontent { position: absolute; left: 0px; top: 38px; width: 100%; -webkit-backface-visibility: hidden; diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.js b/sca-cpp/trunk/modules/js/htdocs/ui.js index f200321ccd..fb53598390 100644 --- a/sca-cpp/trunk/modules/js/htdocs/ui.js +++ b/sca-cpp/trunk/modules/js/htdocs/ui.js @@ -177,28 +177,6 @@ ui.isMobile = function() { return ui.mobile; }; -/** - * Convert a host name to a home page title. - */ -ui.hometitle = function(host) { - if (!isNil(window.top.config.hometitle)) - return window.top.config.hometitle; - var h = reverse(host.split('.')); - var d = isNil(cdr(h))? car(h) : cadr(h); - return d.substr(0, 1).toUpperCase() + d.substr(1); -}; - -/** - * Convert a host name to a window title. - */ -ui.windowtitle = function(host) { - if (!isNil(window.top.config.windowtitle)) - return window.top.config.windowtitle; - var h = reverse(host.split('.')); - var d = isNil(cdr(h))? car(h) : cadr(h); - return d.substr(0, 1).toUpperCase() + d.substr(1); -}; - /** * Convert a CSS position to a numeric position. */ @@ -264,62 +242,75 @@ ui.navigate = function(url, win) { //log('navigate', url, win); // Open a new window - if (win == '_blank') - return window.top.open(url, win); + if (win == '_blank') { + window.top.open(url, win); + return false; + } // Open a new document in the current window - if (win == '_self') - return window.top.open(url, win); + if (win == '_self') { + window.top.open(url, win); + return false; + } // Reload the current window if (win == '_reload') { window.top.location = url; - return window.top.location.reload(); + window.top.location.reload(); + return false; } // Let the current top window handle the navigation if (win == '_view') { if (!window.top.onnavigate) return window.top.open(url, '_self'); - return window.top.onnavigate(url); + window.top.onnavigate(url); + return false; } - return window.top.open(url, win); + window.top.open(url, win); + return false; } /** * Build a portable tag. */ -ui.ahref = function(loc, target, html) { +ui.href = function(id, loc, target, html) { if (target == '_blank') - return '' + html + ''; - return '' + html + ''; + return '' + html + ''; + return '' + html + ''; }; /** * Build a menu bar. */ -ui.menu = function(name, href, target, hilight) { +ui.menu = function(id, name, href, target, hilight) { function Menu() { this.content = function() { - if (hilight) - return ui.ahref(href, target, '' + name + ''); - return ui.ahref(href, target, '' + name + ''); + if (hilight == true) + return ui.href(id, href, target, '' + name + ''); + else if (hilight == false) + return ui.href(id, href, target, '' + name + ''); + else + return ui.href(id, href, target, '' + name + ''); }; } return new Menu(); }; -ui.menufunc = function(name, fun, hilight) { +ui.menufunc = function(id, name, fun, hilight) { function Menu() { this.content = function() { - function href(fun, html) { - return '' + html + ''; + function href(id, fun, html) { + return '' + html + ''; } - if (hilight) - return href(fun, '' + name + ''); - return href(fun, '' + name + ''); + if (hilight == true) + return href(id, fun, '' + name + ''); + else if (hilight == false) + return href(id, fun, '' + name + ''); + else + return href(id, fun, '' + name + ''); }; } return new Menu(); diff --git a/sca-cpp/trunk/modules/js/js-conf b/sca-cpp/trunk/modules/js/js-conf index 09289a1899..aa29920619 100755 --- a/sca-cpp/trunk/modules/js/js-conf +++ b/sca-cpp/trunk/modules/js/js-conf @@ -25,47 +25,27 @@ root=`echo "import os; print os.path.realpath('$1')" | python` cat >>$root/conf/httpd.conf <>$root/conf/pubauth.conf < -AuthType None -Require all granted - AuthType None Require all granted - -AuthType None -Require all granted - AuthType None Require all granted - -AuthType None -Require all granted - AuthType None Require all granted - -AuthType None -Require all granted - AuthType None Require all granted diff --git a/sca-cpp/trunk/modules/oauth/htdocs/index.html b/sca-cpp/trunk/modules/oauth/htdocs/index.html index 8fe4935a4e..006aade244 100644 --- a/sca-cpp/trunk/modules/oauth/htdocs/index.html +++ b/sca-cpp/trunk/modules/oauth/htdocs/index.html @@ -22,9 +22,9 @@ - + - + + + + + + Sign in diff --git a/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/logout/index.html b/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/logout/index.html index 4140eb3b93..50a10bdd8b 100644 --- a/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/logout/index.html +++ b/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/logout/index.html @@ -22,8 +22,8 @@ - - + + Sign out diff --git a/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/index.html b/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/index.html index 34c8dd3986..0caf8b3df1 100644 --- a/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/index.html @@ -21,10 +21,10 @@ - + Joe's Store - + + + Sign in diff --git a/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/logout/index.html b/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/logout/index.html index 4140eb3b93..50a10bdd8b 100644 --- a/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/logout/index.html +++ b/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/logout/index.html @@ -22,8 +22,8 @@ - - + + Sign out diff --git a/sca-cpp/trunk/samples/store-cluster/htdocs/index.html b/sca-cpp/trunk/samples/store-cluster/htdocs/index.html index c1bd39181d..50c7e25ee6 100644 --- a/sca-cpp/trunk/samples/store-cluster/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-cluster/htdocs/index.html @@ -21,7 +21,7 @@ - + Store diff --git a/sca-cpp/trunk/samples/store-cluster/htdocs/login/index.html b/sca-cpp/trunk/samples/store-cluster/htdocs/login/index.html index 9fcafbd5a1..2a7be01ff1 100644 --- a/sca-cpp/trunk/samples/store-cluster/htdocs/login/index.html +++ b/sca-cpp/trunk/samples/store-cluster/htdocs/login/index.html @@ -22,8 +22,8 @@ - - + + Sign in diff --git a/sca-cpp/trunk/samples/store-cluster/htdocs/logout/index.html b/sca-cpp/trunk/samples/store-cluster/htdocs/logout/index.html index 4140eb3b93..50a10bdd8b 100644 --- a/sca-cpp/trunk/samples/store-cluster/htdocs/logout/index.html +++ b/sca-cpp/trunk/samples/store-cluster/htdocs/logout/index.html @@ -22,8 +22,8 @@ - - + + Sign out diff --git a/sca-cpp/trunk/samples/store-cluster/proxy-conf b/sca-cpp/trunk/samples/store-cluster/proxy-conf index 215c25f2f7..c43feff551 100755 --- a/sca-cpp/trunk/samples/store-cluster/proxy-conf +++ b/sca-cpp/trunk/samples/store-cluster/proxy-conf @@ -24,7 +24,7 @@ set -x # Configure a proxy balancer ../../modules/http/httpd-conf $root sca-store.com $port/80 $root/htdocs -../../modules/http/vhost-conf $root $root/domains htdocs +../../modules/http/mass-host-conf $root $root/domains htdocs ../../modules/http/proxy-conf $root ../../modules/http/httpd-event-conf $root diff --git a/sca-cpp/trunk/samples/store-cluster/proxy-ssl-conf b/sca-cpp/trunk/samples/store-cluster/proxy-ssl-conf index b8d202049b..e4ddbb0c4b 100755 --- a/sca-cpp/trunk/samples/store-cluster/proxy-ssl-conf +++ b/sca-cpp/trunk/samples/store-cluster/proxy-ssl-conf @@ -25,12 +25,13 @@ set -x # Configure an SSL-enabled proxy balancer ../../modules/http/httpd-conf $root sca-store.com $port $root/htdocs -../../modules/http/vhost-conf $root $root/domains htdocs +../../modules/http/mass-host-conf $root $root/domains htdocs ../../modules/http/proxy-conf $root ../../modules/http/httpd-event-conf $root tar -C tmp/ssl -c `../../modules/http/ssl-cert-find tmp/ssl` | tar -C $root -x ../../modules/http/httpd-ssl-conf $root $sslport -../../modules/http/vhost-ssl-conf $root +../../modules/http/httpd-tunnel-ssl-conf $root +../../modules/http/mass-host-ssl-conf $root ../../modules/http/proxy-ssl-conf $root # Aggregate proxy balancer logs diff --git a/sca-cpp/trunk/samples/store-cluster/server-conf b/sca-cpp/trunk/samples/store-cluster/server-conf index 5113bc36f4..089e1842db 100755 --- a/sca-cpp/trunk/samples/store-cluster/server-conf +++ b/sca-cpp/trunk/samples/store-cluster/server-conf @@ -25,7 +25,7 @@ set -x # Configure an app server ../../modules/http/httpd-conf $root sca-store.com $port/80 htdocs ../../modules/http/httpd-event-conf $root -../../modules/http/vhost-conf $root domains htdocs +../../modules/http/mass-host-conf $root domains htdocs ../../modules/server/server-conf $root ../../modules/python/python-conf $root cat >>$root/conf/httpd.conf < - + Store - + + + + + + + Sign in diff --git a/sca-cpp/trunk/samples/store-python/htdocs/logout/index.html b/sca-cpp/trunk/samples/store-python/htdocs/logout/index.html index 1108b00e65..92fd2a084b 100644 --- a/sca-cpp/trunk/samples/store-python/htdocs/logout/index.html +++ b/sca-cpp/trunk/samples/store-python/htdocs/logout/index.html @@ -22,8 +22,8 @@ - - + + Sign out diff --git a/sca-cpp/trunk/samples/store-scheme/htdocs/index.html b/sca-cpp/trunk/samples/store-scheme/htdocs/index.html index 4a621631bd..0698a32cc5 100644 --- a/sca-cpp/trunk/samples/store-scheme/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-scheme/htdocs/index.html @@ -21,10 +21,10 @@ - + Store - + + + +