summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/edit/start
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/modules/edit/start')
-rwxr-xr-xsca-cpp/trunk/modules/edit/start51
1 files changed, 19 insertions, 32 deletions
diff --git a/sca-cpp/trunk/modules/edit/start b/sca-cpp/trunk/modules/edit/start
index b9fe5953d6..b2608b245d 100755
--- a/sca-cpp/trunk/modules/edit/start
+++ b/sca-cpp/trunk/modules/edit/start
@@ -17,16 +17,15 @@
# 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`
-# 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
# Configure Python component support
../server/server-conf tmp
@@ -39,15 +38,6 @@ ErrorDocument 404 /notfound/
ErrorDocument 401 /notauth/
ErrorDocument 500 /oops/
-EOF
-
-# Configure app home pages
-cat >>tmp/conf/dvhost.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]
@@ -70,7 +60,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
@@ -81,24 +71,21 @@ EOF
# Create app links and sub-directories if needed
./mkapplinks
-# Configure app aliases
-cat >>tmp/conf/dvhost.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.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