Configuration

After you download the binary and unpack it

Directory structure

---------------

bin/ - has mongoser.sh script to start/stop server

config/

keystore - you ssl keystore, if you decide to run over ssl

logging.properties - logging config

mongodb_server.properties - main config parameters

realm.properties - authentication config, if you decide to turn it on

In file mongoser.sh you can change java heap size

For example JAVA_OPTS="-Xms125m -Xmx512m"

Number of Java threads to process HTTP requests

server.threadsno=50

Your Mongodb database server ip address and port number

It is better to bind your Mongodb database server to loopback ip address so it can

only be accessed locally

list of mongo server:port separated by comma

mongo.servers=127.0.0.1:27017

If you set following parameter to true it will do getLastError() for every write operations and will

return result back, but it will make writes much slower

mongo.safeoperations=false

to remove _id field from all queries

mongo.remove.idfield=true

It either runs in ssl or non ssl mode

ssl mode runs much slower

You can create your keyfile with you cert and put it in config/

REST server address and port

If server.adr is not specified it will bind to all network interfaces

It's is probably better comment server.adr

#server.adr=127.0.0.1

server.port=8081

Help on generating your SSL cert: http://wiki.eclipse.org/Jetty/Howto/Configure_SSL

To turn on ssl, all access will be through https protocol

ssl=true

ssl.keystore=./config/keystore

This is password for both keystore and your cert

ssl.passwd=mongodb

To use memcached server for queries

memcached=true

list of memcached server:port separated by comma

memcached.servers=127.0.0.1:11211,127.0.0.1:11212

Value will expire after this time, set value in seconds, set to 0 to set to max (30 days)

Value can be between 1 and 60*60*24*30 (number of seconds in 30 days)

memcached.expire=5

To turn REST server authentication on

auth=true

There are 3 roles: mongoreadonly, mongowrite, admin

user mongoreadonly can only do queries

user mongowrite can query and write data

user admin can do admin operations: for ex. drop database

To set passwords modify config/auth.properties file

lucene searching

search=true

search.index.path=./searchindex

# which fields to index in form dbname.collectionname.fieldname

search.index.fields=db1.kjv.v,db2.kjv.bk

this is so you can omit this field in search and instead of searching for "fld:sometext" you just search for "sometext"

search.default.field=fld

To turn on basic ip filter

# see examples http://download.eclipse.org/jetty/stable-8/apidocs/org/eclipse/jetty/server/handler/IPAccessHan

dler.html

ip.filter=true

white list (allowed ip address)

ip.filter.white=1.2.3.4

black list (not allowed)

ip.filter.black=4.3.2.1