Incorrect port forwarding

I installed CouchDB in my vagrant 0.9.0 , which runs CentOS 6.2 .

In Vagrantfile I added config.vm.forward_port 5984, 5985 .

After rebooting the firewall, I try to twist the address: curl -v localhost:5985 with bad results.

 * About to connect() to localhost port 5985 (#0) * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 5985 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3 > Host: localhost:5985 > Accept: */* > * Empty reply from server * Connection #0 to host localhost left intact curl: (52) Empty reply from server * Closing connection #0 

I have a feeling that port forwarding does not work properly - at first I thought it might have something to do with iptables , so I turned it off, but, alas, the results did not improve.

I hit my head about this for several days. I would really appreciate your help.

+4
source share
2 answers

It is very likely that your CouchDB is listening on the address 127.0.0.1 virtual machine (and not the physical machine). This is the default value for CouchDB. Do you have the following in local.ini ?

 [httpd] bind_address = 0.0.0.0 

After restarting the CouchDB check using netstat , in the virtual machine , if the change takes effect:

 sudo netstat -tlnp |grep :5984 

Then verify that CouchDB works fine from the virtual machine :

 curl http://127.0.0.1:5984/ 

If you do not see {"couchdb":"Welcome","version":"1.1.1"} , check the logs for error messages. This may be a permission issue.

How did you install CouchDB?

+18
source

in my case, the solution to a very similar problem was much more obvious: coming from ubuntu, I did not expect the firewall to be launched in the centos field

this will disable it:

 sudo service iptables stop 

thanks in this blog !

+5
source

Source: https://habr.com/ru/post/1393469/


All Articles