Open Mind, Open Source…

How to Install couchdb 1.0.1 on Ubuntu 10.04 step by step

Hi,

From last couple of month i am using “Hadoop” and “CouchDB” in my project with Python language. Honestly speaking I was a RDBMS guy, and before worked with “Postgresql“(One of my all time fav. db ) database. So as usual i started applying Rdbms concepts in couchdb (cause for me database means RDBMS)and start working, and totally got frustrated by Couchdb for a complete week. then after that, i started reading CouchDB: The Definitive Guide, and get to know that DBMS is not always RDBMS .  There also some  DB’s which are not using SQL queries to get, put data in db. Ok enough talk lets come to the topic. and try to solve our problems :)

Steps to Install couchdb on ubuntu 10.04:

1. Install the required packages:

Open your terminal and run the following command in your terminal:

#sudo apt-get install libicu-dev libcurl4-gnutls-dev libtool erlang-dev erlang

It will show you a message and ask for your permission to processed. Press “y” and it will start the required pkg installation.

2. Download the couchdb from net:

#wget http://www.fightrice.com/mirrors/apache//couchdb/1.0.1/apache-couchdb-1.0.1.tar.gz

or you can download from below link too by using your browser

http://www.apache.org/dyn/closer.cgi?path=/couchdb/1.0.1/apache-couchdb-1.0.1.tar.gz

3. Extract the compressed file:

#tar xvzf apache-couchdb-1.0.1.tar.gz

it will create a new directory in same directory, where you downloaded the compressed file.

4. Configure The couchdb to install:

#./configure –prefix=<directory path where you installing the couchdb>

e.g #./configure –prefix=/home/maddy/ProgramFiles/couch_install/

SpiderMonkey Problem:  If it will show you the below message, it means “libmozjs-dev” is missing in your system(By default it is not present in ubuntu 10.04) so you need to install it first. Here you have two approach to to solve the problem. First run it with latest Xulrunner(Recommended by apache couchdb, you can find the steps here), second download and install the pkg manually(Below is the steps provided).

Error: configure: error: Could not find the js library.
Is the Mozilla SpiderMonkey library installed?

Solution: download and install

“libmozjs0d” (download: link1, link2) or you can wget also:

“libmozjs-dev” (download: link1, link2) or you can wget also:

#wget http://launchpadlibrarian.net/24586256/libmozjs0d_1.8.1.18%2Bnobinonly.b308.cvs20090331t155113-0ubuntu0.8.10.1_i386.deb

#wget http://launchpadlibrarian.net/17059687/libmozjs-dev_1.8.1.16%2Bnobinonly-0ubuntu1_all.deb

5.  Configure it again:

#./configure –prefix=/home/maddy/ProgramFiles/couch_install/

If it will show you below message after running the configure command again it means everything going fine :)

“You have configured Apache CouchDB, time to relax.
Run `make && sudo make install’ to install.”

6.     install couchDB

#make && sudo make install

It will show you a message like this, and now really time to relax. :)
You have installed Apache CouchDB, time to relax.

7.   Change the directory  permission :

#sudo chown -R <current-ubuntu-username>: ${prefix}/var/{lib,log,run}/couchdb ${prefix}/etc/couchdbsudo

#chmod 0770 ${prefix}/var/{lib,log,run}/couchdb ${prefix}/etc/couchdb

8. Start the server:

go to couch install directory and run

#./etc/init.d/couchdb start

Error: * Starting database server

chown: changing ownership of `/home/maddy/ProgramFiles/couch_install/var/run/couchdb’: Operation not permitted

su: Authentication failure

Solution: /home/maddy/ProgramFiles/couch_install/etc/default #  sudo vim couchdb ,

Now change the “COUCHDB_USER=couchdb” to COUCHDB_USER=<ubuntu-user-name>

and start the couchdb server again

#./etc/init.d/couchdb start

9.     Open browser and check this link  http://localhost:5984/_utils

10.  Time for beer     :)

 

Cheers !!
Open Mind, Open Source

Advertisement

2 Responses

  1. test

    Thank you very much for your good instruction. This is what i need

    October 1, 2011 at 3:30 PM

  2. Amit

    In case failure is found on ubuntu 11.04, please refer:

    comments.gmane.org/gmane.comp.db.couchdb.user/14197

    October 11, 2011 at 12:44 PM

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.