diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-11-10 02:36:40 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-11-10 02:36:40 +0000 |
commit | 52cd682405f7a052d45d83b66cc75f19316ceffe (patch) | |
tree | 6b76eeddb2d4682db61f8e38462413bc40b59a3d /sca-cpp/trunk/modules/edit/ssl-start | |
parent | 629c1f267e5f7a835891e36ebdae8404740f13e2 (diff) |
Enable multiple apps to co-exist under different paths in a single Virtual Host and Internet domain.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1200105 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rwxr-xr-x | sca-cpp/trunk/modules/edit/ssl-start | 66 |
1 files changed, 20 insertions, 46 deletions
diff --git a/sca-cpp/trunk/modules/edit/ssl-start b/sca-cpp/trunk/modules/edit/ssl-start index 050de3e83c..919a19f4bb 100755 --- a/sca-cpp/trunk/modules/edit/ssl-start +++ b/sca-cpp/trunk/modules/edit/ssl-start @@ -17,8 +17,8 @@ # specific language governing permissions and limitations # under the License. -# For this module to work, add the app domains to your /etc/hosts as follows: -# 127.0.0.1 sca-store.com abc.sca-store.com xyz.sca-store.com ... +# For this module to work, add the sca-store.com domain to your /etc/hosts as follows: +# 127.0.0.1 sca-store.com here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` jsprefix=`echo "import os; print os.path.realpath('$here/../js')" | python` @@ -26,14 +26,11 @@ jsprefix=`echo "import os; print os.path.realpath('$here/../js')" | python` # Create SSL certificates ../../modules/http/ssl-ca-conf tmp sca-store.com ../../modules/http/ssl-cert-conf tmp sca-store.com server -../../modules/http/ssl-cert-conf tmp *.sca-store.com vhost -# Configure server with virtual hosting +# Configure server ../../modules/http/httpd-conf tmp sca-store.com 8090 htdocs ../../modules/http/httpd-event-conf tmp -../../modules/http/vhost-conf tmp apps htdocs ../../modules/http/httpd-ssl-conf tmp 8453 -../../modules/http/vhost-ssl-conf tmp # Configure authentication ../../modules/http/open-auth-conf tmp @@ -55,15 +52,6 @@ ErrorDocument 404 /notfound/ ErrorDocument 401 /notauth/ ErrorDocument 500 /oops/ -EOF - -# Configure app home pages -cat >>tmp/conf/dvhost-ssl.conf <<EOF -# App error pages -ErrorDocument 404 /notfound/ -ErrorDocument 401 /notauth/ -ErrorDocument 500 /oops/ - # Redirect www to main home page RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC] @@ -74,17 +62,6 @@ RewriteRule .* https://sca-store.com%{REQUEST_URI} [L,R] EOF -cat >>tmp/conf/dvhost.conf <<EOF -# Redirect www to main home page -RewriteEngine on -RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC] -RewriteCond %{SERVER_PORT} !^80$ -RewriteRule .* http://sca-store.com:%{SERVER_PORT}%{REQUEST_URI} [L,R] -RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC] -RewriteRule .* http://sca-store.com%{REQUEST_URI} [L,R] - -EOF - # Configure SCA contributions cat >>tmp/conf/httpd.conf <<EOF @@ -98,7 +75,7 @@ SCAVirtualComposite app.composite EOF -# Configure main aliases +# Configure resource aliases cat >>tmp/conf/httpd.conf <<EOF Alias /home/home.png $here/htdocs/home/home.png @@ -109,24 +86,21 @@ EOF # Create app links and sub-directories if needed ./mkapplinks -# Configure app aliases -cat >>tmp/conf/dvhost-ssl.conf <<EOF -# Configure aliases -Alias /cache-manifest.cmf $here/htdocs/app/cache-manifest.cmf -Alias /data $here/htdocs/data -Alias /favicon.ico $here/htdocs/favicon.ico -Alias /footconfig.js $here/htdocs/footconfig.js -Alias /frame.html $here/htdocs/app/frame.html -Alias /headconfig.js $here/htdocs/headconfig.js -Alias /index.html $here/htdocs/app/index.html -Alias /login $here/htdocs/login -Alias /logout $here/htdocs/logout -Alias /notauth $here/htdocs/notauth -Alias /notfound $here/htdocs/notfound -Alias /notyet $here/htdocs/notyet -Alias /oops $here/htdocs/oops -Alias /public $here/htdocs/public -Alias /robots.txt $here/htdocs/robots.txt +# Configure app resource aliases +cat >>tmp/conf/svhost-ssl.conf <<EOF + +<Location /v> +RewriteEngine on + +# Map /v/<app-name>/<path> to htdocs/app/<path> +RewriteCond %{REQUEST_URI} ^/v/.+/.*$ +RewriteRule /v/(.+)/(.*)$ $here/htdocs/app/\$2 [L] + +# Redirect /v/<app-name> to /<app-name>/ +RewriteCond %{REQUEST_URI} ^/v/[^/]+$ +RewriteRule /v/([^/]+)$ /\$1/ [L,R] + +</Location> EOF @@ -137,5 +111,5 @@ mkdir -p tmp/appdata/filedb ../../components/cache/memcached-start # Start server -../../modules/http/httpd-start tmp +../http/httpd-start tmp |