Skip to content

Instantly share code, notes, and snippets.

@yblee85
Last active March 16, 2016 20:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yblee85/832b82999a00768c28e7 to your computer and use it in GitHub Desktop.
Save yblee85/832b82999a00768c28e7 to your computer and use it in GitHub Desktop.
Install CouchDB 1.6.1 on Ubuntu 14.04 (origin : pixelpark/ppnet)
# via http://wiki.apache.org/couchdb/Installing_on_Ubuntu
sudo apt-get install --yes build-essential curl git
sudo apt-get install --yes python-software-properties python g++ make
sudo apt-get install -y erlang-dev erlang-manpages erlang-base-hipe erlang-eunit erlang-nox erlang-xmerl erlang-inets
sudo apt-get install -y libmozjs185-dev libicu-dev libcurl4-gnutls-dev libtool
# via http://ftp.fau.de/apache/couchdb/source/1.6.1/
cd /tmp
wget http://ftp.fau.de/apache/couchdb/source/1.6.1/apache-couchdb-1.6.1.tar.gz
tar xvzf apache-couchdb-*
cd apache-couchdb-*
./configure && make
sudo make install
useradd -d /var/lib/couchdb couchdb
chown -R couchdb: /var/lib/couchdb /var/log/couchdb
# vi /etc/passwd here and change home directory to /usr/local/var/lib/couchdb/
chown -R couchdb: /usr/local/var/{lib,log,run}/couchdb /usr/local/etc/couchdb
chmod 0770 /usr/local/var/{lib,log,run}/couchdb/
chmod 664 /usr/local/etc/couchdb/*.ini
chmod 775 /usr/local/etc/couchdb/*.d
cd /etc/init.d
ln -s /usr/local/etc/init.d/couchdb couchdb
/etc/init.d/couchdb start
update-rc.d couchdb defaults
curl http://127.0.0.1:5984/
# vi /usr/local/etc/couchdb/default.ini
# change bind_adress to 0.0.0.0
service couchdb restart
=============================================================
after installation,
you can modify /var/local/etc/local.ini
and if you want to port forwarding to listen to port 80
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 5984
// to make it permanent
apt-get install iptables-persistent
iptables-save > /etc/iptables/rules.v4 (may not need)
@yblee85
Copy link
Author

yblee85 commented Sep 30, 2015

in case you can't install earlang stuff
sudo apt-get install -y erlang-base erlang-dev erlang-nox erlang-eunit

in case you can't install libmozjs185 ....
add "deb http://archive.ubuntu.com/ubuntu trusty main restricted multiverse universe"
to /etc/apt/sources.list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment