Koozali.org: home of the SME Server
Obsolete Releases => SME Server 8.x => Topic started by: kropek on July 31, 2013, 04:07:38 AM
-
I've installed couchdb on sme server 8 via epel.
I want to open port 5984 to both public and internal networks.
First I tried to do this via the server manager- port forwarding utility. I set both source and destination ports to 5984, and localhost as the destination host ip address. I tested the results with curl http://localhost:5984 and remotely via http://<tld>:5984. This did not work (I received no response from the server) in either case.
Next, I looked at the example solution for setting up a tomcat server (http://wiki.contribs.org/Tomcat (http://wiki.contribs.org/Tomcat)), since it looked like the tomcat and couchdb installs are reasonably similar. Similar in that both place scripts in /etc/rc.d/init.d/, and copy them to /etc/rc.d/rc#.d/, etc.
I then tried running:
config set couchdb service access public status enabled TCPPort 5984
signal-event remoteaccess-update
There were no errors after doing this, and I can see the key is present in config, but I'm still not able to access couchdb remotely.
I'm wondering
1) if anyone can explain why the port forwarding solution won't work (I have verified my couchdb server is running on sme, and can curl http://localhost:5984 and get a valid response)?
2) whether the port forwarding solution or config solution is preferable for a service running on sme?
Any help would be really appreciated.
-
Did you stop the port forwarding made in first attempt pripr to the second config?
-
thanks for your response.
yes, i removed the port forwarding configuration prior to attempting the second, config solution.
-
Are you sure couchdb is listening on the external interface, and not just the internal one ?
The config command you used (config set couchdb service etc...) seems OK, you can check the Firewall has inserted a rule by looking at the output of:
iptables -L -vn | less
To check the service is listening, try to run:
netstat -laputen | grep 5984
You should see on which IP the service is listening, which should be 0.0.0.0:5984 if the service is listening on any IP/interface
-
From this serverfault post, I suspect that couchdb listens on 127.0.0.1 by default:
http://serverfault.com/questions/79453/why-cant-i-access-my-couchdb-instance-externally-on-ubuntu-9-04-server
As I read the solution in that post, you need to change 'BindAddress' from 127.0.0.1 to 0.0.0.0 in couch.ini, then stop and restart the service.
-
Fixed! Thanks for your help!
I made the change to couch.ini and restarted the service- thanks for the tip mmccarn.
I verified the change via netstat and iptables commands - thanks Daniel B!