Skip to content

Instantly share code, notes, and snippets.

@tisba
Created August 12, 2010 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tisba/521297 to your computer and use it in GitHub Desktop.
Save tisba/521297 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Build CouchDB 1.0.1 from source using build-couchdb. All needed dependencies
# are also build from source and form a self-contained installation. Specifiy
# COUCHDB_PREFIX to the location where you would like to have everything
# installed to.
# When everything is done, the init.d-script and default settings for CouchDB
# are linked to the right places, the bind address is set to 0.0.0.0 and CouchDB
# will be started, so you can relax!
COUCHDB_PREFIX=/usr/local/couchdb-1.0.1
apt-get update
apt-get -y install make gcc zlib1g-dev libssl-dev libreadline5-dev bison \
rake \
git-arch
git clone git://github.com/couchone/build-couchdb.git
cd build-couchdb
git submodule init
git submodule update
PREFIX=$COUCHDB_PREFIX rake couchdb_build=$COUCHDB_PREFIX
ln -s $COUCHDB_PREFIX/etc/init.d/couchdb /etc/init.d/couchdb
ln -s $COUCHDB_PREFIX/etc/default/couchdb /etc/default/couchdb
update-rc.d couchdb defaults
adduser --system \
--home $COUCHDB_PREFIX/var/lib/couchdb \
--no-create-home \
--shell /bin/bash \
--group \
--gecos "CouchDB Administrator" \
couchdb
chown -R couchdb:couchdb $COUCHDB_PREFIX/{etc,var/lib,var/run,var/log}/couchdb
curl -X PUT http://127.0.0.1:5984/_config/httpd/bind_address -d '"0.0.0.0"'
/etc/init.d/couchdb start
@tisba
Copy link
Author

tisba commented Aug 12, 2010

This script uses Jason Smith's build-couchdb (http://github.com/jhs/build-couchdb) to build a self-contained version of CouchDB with all its dependencies, place it where you want, install the proper init.d-script and makes it start at system boot.

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