3

I am trying to work with some third-party code that does

couchdb -a ./my/couch.ini

This does not work on Windows because the couchdb.bat file does not pass arguments through to CouchDB. So CouchDB always starts up on the default port (5984), instead of the one specified in ./my/couch.ini (15984).

I tried manually passing arguments through by using the contents of the batch file. I.e.

cd "C:\Program Files (x86)\Apache Software Foundation\CouchDB\bin"
erl -sasl errlog_type error -s couch -a /full/path/to/my/couch.ini

But this doesn't seem to do anything, i.e. it's still on 5984.

I tried a few variants of /full/path/to/my/couch.ini, e.g. C:/full/path/to/my/couch.ini and C:\full\path\to\my\couch.ini and C:\\full\\path\\to\\my\\couch.ini, but there was no difference.

Has anyone been able to run CouchDB on Windows with a custom couch.ini file?

Domenic
  • 110,262
  • 41
  • 219
  • 271

3 Answers3

3

I don't have a windows box right now to confirm, but you may not need to include the default and local parameters below. Add this just before -s couch in couchdb.bat:

 -couch_ini ../etc/couchdb/default.ini ../etc/couchdb/local.ini /path/to/custom/couch.ini

Notes:

  • all paths are relative to %COUCH%/bin/

  • the last ini file specified needs to be writable, this is where updated parameters should go

  • secure your whitelisted parameters by putting them in one of the readable files first

FWIW, the unix syntax on my homebrewed mac version is:

usr/local/Cellar/erlang/R15B01/lib/erlang/erts-5.9.1/bin/beam.smp -Bd -K true -A 4 -- -root /usr/local/Cellar/erlang/R15B01/lib/erlang -progname erl -- -home ~ -- -noshell -noinput -os_mon start_memsup false start_cpu_sup false disk_space_check_interval 1 disk_almost_full_threshold 1 -sasl errlog_type error -couch_ini /usr/local/etc/couchdb/default.ini /usr/local/etc/couchdb/local.ini -s couch

If you log a jira ticket describing what you want to achieve, I'll see if I can get it into 1.3.0.

dch
  • 1,502
  • 9
  • 9
1

In theory you should just edit your local.ini located under

$PROGRAMS_DIR\Apache Software Foundation\CouchDB\etc

CouchDB will parse this configuration file by default. I know it is not exactly what you've asked for but I guess that is the only way to do it.

Octavian Helm
  • 39,405
  • 19
  • 98
  • 102
1

I've modified in both: C:\Program Files (x86)\Apache Software Foundation\CouchDB\etc\couchdb\local.ini C:\Program Files (x86)\Apache Software Foundation\CouchDB\etc\couchdb\defaults.ini

the section [httpd] to be:

port = 5984
bind_address = 0.0.0.0

And restarted CouchDB. That helped

Valentin H
  • 7,240
  • 12
  • 61
  • 111