Why can't I access my CouchDB instance externally on Ubuntu 9.04 server?

Solution 1:

What does netstat -an | grep 5984 say? Does it say 127.0.0.1:5984 or *:5984? If it's 127.0.0.1, then couchdb needs to be set to listen to either all interfaces.

Solution 2:

You have to change the bind_address in /etc/couchdb/default.ini. Then restart the service and try again.


Solution 3:

I noticed that in order for this to work you must manually kill the running erlang process for some reason.ps ax | grep beam ought to reveal the erlang process, you should get something along lines of 0:00 /usr/lib/erlang/erts somewhere in the output. If you kill this process and then run /etc/init.d/couchdb restart the new config file will be loaded.


Solution 4:

On home PC/Mac run this command:

ssh -L 5984:localhost:5984 YOUR-SERVER-IP-HERE

next open in your browser localhost:5984/_utils ... It works for me


Solution 5:

Configuration docs:

bind_address

If you change it from the Futon configuration panel, you don't have to do anything else (rebooting the db etc.):

enter image description here

Before changing the default bind_address:

peter@earth:~/$ netstat -an | grep 5984
tcp        0      0 127.0.0.1:5984          0.0.0.0:*               LISTEN

After changing to 0.0.0.0:

peter@earth:~/$ netstat -an | grep 5984
tcp        0      0 0.0.0.1:5984          0.0.0.0:*               LISTEN

Note non-gurus: computers which cannot access yours (normally, anything outside your local network) will still not be able to access your computer (CouchDB or anything else).