diff --git a/deploy/lib/server_config.rb b/deploy/lib/server_config.rb
index 68eac185..61391cc4 100644
--- a/deploy/lib/server_config.rb
+++ b/deploy/lib/server_config.rb
@@ -1534,7 +1534,7 @@ def deploy_rest
# Figure out where we need to deploy this stuff
rest_modules_db = ''
if @properties.has_key?('ml.rest-port') and @properties['ml.rest-port'] != ''
- rest_modules_db = "#{@properties['ml.app-name-rest-modules']}"
+ rest_modules_db = conditional_prop('ml.rest-modules-db', 'ml.modules-db')
else
rest_modules_db = @properties['ml.modules-db']
end
@@ -2103,6 +2103,7 @@ def build_config(config_file)
if @properties['ml.rest-port'].present?
# Set up a REST API app server, distinct from the main application.
+ rest_modules_db = conditional_prop('ml.rest-modules-db', 'ml.modules-db')
rest_auth_method = conditional_prop('ml.rest-authentication-method', 'ml.authentication-method')
rest_default_user = conditional_prop('ml.rest-default-user', 'ml.default-user')
@@ -2121,9 +2122,9 @@ def build_config(config_file)
@ml.app-name-rest
@ml.rest-port
-
+
#{rest_auth_method}
-
+
#{rest_url_rewriter}
/MarkLogic/rest-api/error-handler.xqy
true
@@ -2133,9 +2134,9 @@ def build_config(config_file)
config.gsub!("@ml.rest-modules-db-xml",
%Q{
- @ml.app-name-rest-modules
+ #{rest_modules_db}
-
+
})
@@ -2143,7 +2144,7 @@ def build_config(config_file)
config.gsub!("@ml.rest-modules-db-assignment",
%Q{
- @ml.app-name-rest-modules
+ #{rest_modules_db}
})
diff --git a/deploy/sample/build.sample.properties b/deploy/sample/build.sample.properties
index 2991bc62..bbba9a6a 100644
--- a/deploy/sample/build.sample.properties
+++ b/deploy/sample/build.sample.properties
@@ -67,6 +67,18 @@ app-port=8040
xcc-port=8041
# odbc-port=8043
+## Separate REST api instance
+#
+# In case you don't want to expose a REST api directly, or want to
+# run a REST api next to a different app server, uncomment the
+# rest-port property. Additionally you can override modules-db,
+# auth method, and default user as well:
+#
+# rest-port=8044
+# rest-modules-db=${app-name}-rest-modules
+# rest-authentication-method=${authentication-method}
+# rest-default-user=${default-user}
+
#
# set this to false if you are using an existing XCC server and
# you don't want Roxy to manage it for you