couchdbfauxtoncouchdb-3.x

CouchDB change bind_address without using Fauxton


I would like to update the bind address of my CouchDB v3.1.0 instance (note: installed on Windows 10).

I would like to do so without using the Web UI (Fauxton).

Here is what I am doing:

  1. Opening C:\CouchDB\etc\local.ini in a text editor
  2. Within the [chhtpd] section, I am setting bind_address = 0.0.0.0
[chttpd]
;port = 5984
bind_address = 0.0.0.0
; Options for the MochiWeb HTTP server.
;server_options = [{backlog, 128}, {acceptor_pool_size, 16}]
; For more socket options, consult Erlang's module 'inet' man page.
;socket_options = [{sndbuf, 262144}, {nodelay, true}]
  1. Saving the changes
  2. Restarting the Apache CouchDB service via services.msc
  3. I find the change of bind_address hasn't taken effect

It seems the [chttpd] section of C:\CouchDB\etc\local.d\10-admins.ini is overriding my value.

[chttpd]
bind_address = 127.0.0.1
port = 5984

What am I doing wrong? Do I need to change the bind_address in the 10-admins.ini file?


Solution

  • You are correct, you need to change the bind address in etc\local.d\10-admins.ini file.
    According to the CouchDB documentation, files etc/local.d/*.ini take precedence:

    By default, CouchDB reads configuration files from the following locations, in the following order:

    etc/default.ini
    etc/default.d/*.ini
    etc/local.ini
    etc/local.d/*.ini
    

    All paths are specified relative to the CouchDB installation directory: /opt/couchdb recommended on UNIX-like systems, C:\CouchDB recommended on Windows systems, and a combination of two directories on macOS: Applications/Apache CouchDB.app/Contents/Resources/couchdbx-core/etc for the default.ini and default.d directories, and /Users/youruser/Library/Application Support/CouchDB2/etc/couchdb for the local.ini and local.d directories.

    Settings in successive documents override the settings in earlier entries. For example, setting the chttpd/bind_address parameter in local.ini would override any setting in default.ini.