Skip to content

Instantly share code, notes, and snippets.

@mariomartinezsz
Last active December 30, 2015 05:29
Show Gist options
  • Save mariomartinezsz/7782936 to your computer and use it in GitHub Desktop.
Save mariomartinezsz/7782936 to your computer and use it in GitHub Desktop.
Install CouchDB 1.5.0 on Ubuntu Server (Tested with Ubuntu Server 12.04 LTS Precise Pangolin)
#!/bin/sh
# Based on http://jswiki.lab-01.com/wiki/doku.php?id=install-couch
echo "Downloading Linux build tools and Erlang"
sudo apt-get install build-essential libicu-dev libcurl4-gnutls-dev libtool erlang-dev erlang zip -y
# Work on tmp directory
cd /tmp
# Spidermonkey is required
echo "Spidermokey ..."
wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
tar xfz js185-1.0.0.tar.gz
cd js-1.8.5/js/src
./configure
make
sudo make install
sudo /sbin/ldconfig
echo "Spidermonkey installed."
# Return to tmp directory
cd /tmp
# Get CouchDB source code
echo "CouchDB ..."
wget http://mirror.reverse.net/pub/apache/couchdb/source/1.5.0/apache-couchdb-1.5.0.tar.gz
tar xfz apache-couchdb-1.5.0.tar.gz
cd apache-couchdb-1.5.0
./configure
make
sudo make check
sudo make install
echo "CouchDB installed."
# Add couchdb user
echo "Adding couchdb user ..."
sudo useradd -d /usr/local/var/lib/couchdb couchdb
sudo chown -R couchdb:couchdb /usr/local/etc/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/lib/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/log/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/run/couchdb
sudo chmod -R 0770 /usr/local/etc/couchdb
sudo chmod -R 0770 /usr/local/var/lib/couchdb
sudo chmod -R 0770 /usr/local/var/log/couchdb
sudo chmod -R 0770 /usr/local/var/run/couchdb
echo "Done."
echo "Now you can modify /usr/local/etc/couchdb/local.ini"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment