Skip to content

Instantly share code, notes, and snippets.

@mariomartinezsz
Last active December 25, 2015 10:59
Show Gist options
  • Save mariomartinezsz/6965391 to your computer and use it in GitHub Desktop.
Save mariomartinezsz/6965391 to your computer and use it in GitHub Desktop.
Install CouchDB 1.4.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.4.0/apache-couchdb-1.4.0.tar.gz
tar xfz apache-couchdb-1.4.0.tar.gz
cd apache-couchdb-1.4.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 "I will try to write a /etc/init/couchdb.conf file."
sudo printf 'start on runlevel [2345]\nstop on runlevel [016]\nscript\n exec sudo -i -u couchdb couchdb\nend script\n\nrespawn' > /etc/init/couchdb.conf
echo "Done."
echo "Now you can modify /usr/local/etc/couchdb/local.ini"
@mariomartinezsz
Copy link
Author

wget -O install-couchdb-1.4.0.sh http://git.io/QlKOwg
sudo chmod +x install-couchdb-1.4.0.sh

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