Installing CouchDB on Mac OS X Leopard

Howdy!

I had installed CouchDB using Mac Ports but looks like ports installs an old and bugged version of CouchDb. So I decided to uninstall the couchdb and install it straight from source.

Here we go. Open your terminal and follow the instructions.

Installing CouchDB dependencies

First step is to install the ICU (International Components for Unicode). Execute the following commands:

$ curl -O http://download.icu-project.org/files/icu4c/4.2.1/icu4c-4_2_1-src.tgz
$ tar xvf icu4c-4_2_1-src.tgz
$ cd icu/source
$ ./configure --prefix=/usr/local
$ make
$ make install
$ cd ~

Now, we need to install another dependency, the SpiderMonkey, which is a Mozilla Foundation Javascript engine.

$ curl -O ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz
$ tar xvf js-1.7.0.tar.gz
$ cd js/src
$ make BUILD_OPT=1 -f Makefile.ref
$ sudo mkdir -p /usr/include/smjs
$ sudo cp *.(h,tbl} /usr/include/smjs/
$ cd Darwin_OPT.OBJ
$ sudo cp *.h /usr/include/smjs/
$ sudo cp js /usr/local/bin/
$ sudo cp libjs.dylib /usr/local/lib/
$ cd ~

CouchDB is developed in Erlang, so we also need to install Erlang

$ curl -O http://www.erlang.org/download/otp_src_R13B01.tar.gz
$ tar xzf otp_src_R13B01.tar.gz
$ cd otp_src_R13B01
$ ./configure --prefix=/usr/local \
  --enable-smp-support --enable-hipe --enable-darwin-universal \
  --enable-threads
$ make
$ make install
$ cd ~

Installing CouchDB

$ svn co http://svn.apache.org/repos/asf/couchdb/trunk couchdb
$ cd couchdb
$ ./bootstrap
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ cd ~

After the compiling and installing, you can check the couchdb version

$ couchdb -V

To start the couchdb:

$ sudo couchdb -b

Now, you can open your browser and access the couchdb:

http://127.0.0.1:5984/_utils

To stop couchdb:

$ sudo couchdb -d

That’s all folks

2 comments so far

  1. Jan on

    Hey,

    thanks for the write up. Most recent install instructions are always in the CouchDB (capital B) README file.

    I’d advise to use 127.0.0.1 instead of localhost because that’ll still work if ipv6 is enabled (which is the default)

    Cheers
    Jan

    • Leonardo on

      Thanks Jan! I’ve update the post to use 127.0.0.1 instead of localhost!😀


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: