Skip to content

Instantly share code, notes, and snippets.

@cesine
Forked from msmith/couchdb-ec2-install.sh
Created July 3, 2012 05:31
Show Gist options
  • Save cesine/3037896 to your computer and use it in GitHub Desktop.
Save cesine/3037896 to your computer and use it in GitHub Desktop.
Set up CouchDB on EC2
#!/bin/bash
#
# For http://stackoverflow.com/questions/6162891/installing-couchdb-in-aws-ec2-free-tier
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
# It is a modified fork of the original rake script, but does not use rake (just good ol' linux tools)
# Based on: http://wiki.apache.org/couchdb/Installing_on_RHEL5
# The Install dependancies must be run with root privileges,
# but the couchdb install can be done without root priviledges.
# You need to change 1 line in your repos:
# sudo vi /etc/yum.repos.d/epel.repo
# Under the section marked [epel], change enabled=0 to enabled=1.
#
# Tested with Amazon Linux AMI release 2012.10.12
export INSTALL_DIR="$HOME/couchdb"
# install couchdb dependancies
sudo yum --enablerepo=epel install libicu-devel openssl-devel curl-devel make gcc erlang js-devel libtool which
if [ ! -e $INSTALL_DIR ]
then
curl -O --retry 999 --retry-max-time 0 -C - http://apache.skazkaforyou.com/couchdb/releases/1.2.0/apache-couchdb-1.2.0.tar.gz
tar -zxvf apache-couchdb-1.2.0.tar.gz
cd apache-couchdb-1.2.0
./configure --prefix=$INSTALL_DIR --with-erlang=/usr/lib64/erlang/erts-5.8.5/include
make
make install
fi
# done!
echo
echo
echo "Installation complete!"
echo "Be sure to lock down your couch by adding a password,"
echo "Your couchdb is installed in $INSTALL_DIR,"
echo "Your local.ini config file is in $INSTALL_DIR/etc"
echo
echo "Couchdb is ready to start. Run:"
echo " $INSTALL_DIR/bin/couchdb start"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment