Skip to content

Instantly share code, notes, and snippets.

@allexiusw
Last active November 15, 2019 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allexiusw/1dd5b620517ce07700962b05986fbaf5 to your computer and use it in GitHub Desktop.
Save allexiusw/1dd5b620517ce07700962b05986fbaf5 to your computer and use it in GitHub Desktop.
Install Couch Sync Gateway for Mobiles
#!/bin/bash
#services are exposed to Public IP, but for security you can use nginx as gateway.
#get the package of couch sync gateway
wget http://packages.couchbase.com/releases/couchbase-sync-gateway/2.6.0/couchbase-sync-gateway-community_2.6.0_x86_64.deb
#install the package
dpkg -i couchbase-sync-gateway-community_2.6.0_x86_64.deb
#start your service
systemctl start sync-gateway.service
#check status
systemctl status sync-gateway.service
#check open ports
netstat -tln
#make the services publics
nano /home/sync_gateway/sync_gateway.json
#delete all information and paste this
"adminInterface": "0.0.0.0:4985",
"interface": "0.0.0.0:4984",
"databases": {
"mydb": {
"server": "walrus:data",
"users": {
"admin": {"disabled": false, "password":"1234", "admin_channels": ["*"] }
},
"allow_conflicts": false,
"revs_limit": 20
}
}
#save the information
#restart the service sync-wateway
systemctl restart sync-gateway.service
#check again the ports running
netstat -tln
#if you are behind a firewall allow the ports 4985 and 4984
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment