13
Jan
0

Installing CouchDB 1.0.1 on RHEL4 as the local user

On some of the servers I use I don’t have root access. This means occasionally it can be a hassle to install packages when the dependencies aren’t available.

Recently I had to install CouchDB and it’s dependencies from source. The tricky bit was having to edit the CouchDB configure script to specify the Curl libraries.

In this example I’ve assumed the user home directory is ‘/home/your_user’, with the Couch and it’s dependencies ending up in ‘/home/your_user/db/couch/’.

# Erlang 5.6.5
wget http://www.erlang.org/download/otp_src_R12B-5.tar.gz
tar -zxvf otp_src_R12B-5.tar.gz
cd otp_src_R12B-5
./configure --prefix=/home/your_user/db/couch/erlang
make && make install

# SpiderMonkey 1.7.0
wget http://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz
tar -zxvf js-1.7.0.tar.gz
cd js/src/
make -f Makefile.ref
make BUILD_OPT=1 JS_DIST=/home/your_user/db/couch/spidermonkey/ \
  -f Makefile.ref export

# ICU 4.6
wget http://download.icu-project.org/files/icu4c/4.6/icu4c-4_6-src.tgz
tar -zxvf icu4c-4_6-src.tgz
cd icu
./configure --prefix=/home/your_user/db/couch/icu
make && make install

# Curl 7.21.2
wget http://curl.haxx.se/download/curl-7.21.2.tar.gz
tar -zxvf curl-7.21.2.tar.gz
cd curl-7.21.2
./configure --prefix=/home/your_user/db/couch/curl
make && make install

# Add the programs to your $PATH
export PATH=$PATH:/home/your_user/db/couch/erlang/bin
export PATH=$PATH:/home/your_user/db/couch/spidermonkey/bin
export PATH=$PATH:/home/your_user/db/couch/icu/bin
export PATH=$PATH:/home/your_user/db/couch/curl/bin
export LD_LIBRARY_PATH=/home/your_user/db/couch/icu/lib

# CouchDB 1.0.1
wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org//couchdb/1.0.1/apache-couchdb-1.0.1.tar.gz
tar -zxvf apache-couchdb-1.0.1.tar.gz
cd apache-couchdb-1.0.1
## edit configure.  Search for CURL_LDFLAGS=-lcurl.
## Replace with: CURL_LDFLAGS="-L/home/your_user/db/couch/curl/lib -lcurl"
./configure --prefix=/home/your_user/db/couch/couchdb \
  --with-js-lib=/home/your_user/db/couch/spidermonkey/lib \
  --with-js-include=/home/your_user/db/couch/spidermonkey/include \
  --with-erlang=/home/your_user/db/couch/erlang/lib/erlang/usr/include
make && make install

# Start up CouchDB
/home/your_user/db/couch/couchdb/bin/couchdb
# Time to Relax.
# From this command you should see: {"couchdb":"Welcome","version":"1.0.1"}
curl http://127.0.0.1:5984/
Enjoyed reading this post?
Subscribe to the RSS feed and have all new posts delivered straight to you.
Post your comment