Skip to content

Instantly share code, notes, and snippets.

@svparijs
Forked from radmiraal/install_couchdb.sh
Created December 13, 2012 11:52
Show Gist options
  • Save svparijs/4275938 to your computer and use it in GitHub Desktop.
Save svparijs/4275938 to your computer and use it in GitHub Desktop.
# Guide based on http://wiki.apache.org/couchdb/Installing_on_Debian
# Install dependencies
aptitude install -y build-essential libtool autoconf automake autoconf-archive pkg-config libssl0.9.8 libssl-dev zlib1g zlib1g-dev libcurl4-openssl-dev lsb-base ncurses-dev libncurses-dev libmozjs-dev libmozjs2d libicu-dev xsltproc
# Installing Erlang/OTP
cd /tmp/
wget http://www.erlang.org/download/otp_src_R15B01.tar.gz
tar xzf otp_src_R15B01.tar.gz
cd otp_src_R15B01
echo "skipping gs" > lib/gs/SKIP
echo "skipping jinterface" > lib/jinterface/SKIP
echo "skipping odbc" > lib/odbc/SKIP
echo "skipping wx" > lib/wx/SKIP
./configure --prefix=/usr/local
make && make install
# Test erlang installation
erl -eval "case application:load(crypto) of ok -> io:format(\"crypto is working~n\", []), ok; _ -> exit(no_crypto) end." -noshell -s init stop.
# Install couchdb
cd /tmp/
wget http://apache.mirror.versatel.nl/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=/usr/local --with-js-lib=/usr/lib --with-js-include=/usr/include/mozjs --enable-init
make && make check && make install
# For me a test failed during the make process. Mailing lists learn that # this test is trivial test: http://mail-archives.apache.org/mod_mbox/couchdb-user/201204.mbox/%[email protected]%3E
# I removed the test from the build process and ran make again
useradd -d /var/lib/couchdb couchdb
chown -R couchdb:couchdb /usr/local/{lib,etc}/couchdb /usr/local/var/{lib,log,run}/couchdb
chmod -R g+rw /usr/local/{lib,etc}/couchdb /usr/local/var/{lib,log,run}/couchdb
# Start couchdb
couchdb&
# Test couchdb
curl http://127.0.0.1:5984/ \
&& curl -X PUT http://localhost:5984/test/ \
&& curl -X GET http://localhost:5984/test/ \
&& curl -X POST http://localhost:5984/test/ -H "Content-Type: application/json" -d {} \
&& curl -X GET http://localhost:5984/test/_all_docs \
&& curl -X DELETE http://localhost:5984/test/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment