Weblogs: Web Development
Installing CouchDB on Jeos 8.04
Tuesday, July 28, 2009JEOS (Just Enough Operating System) is a wonderful baseline for creating Linux-based virtual machines for web development. Bradley Wright has written up the best set of instructions for creating a new virtual machine for web development running on JEOS and that is the starting point for building a CouchDB server.
With a bare-bones server up and running it's time to install CouchDB. CouchDB is available as an apt install on Ubuntu 8.10 and above, but it won't be the cutting edge code and so some features may be missing. So I had no choice but to go for the tar.gz install. But first, we can install the package dependencies:
- sudo apt-get install automake autoconf libtool subversion-tools help2man
- sudo apt-get install build-essential erlang libicu38 libicu-dev
- sudo apt-get install libreadline5-dev checkinstall libmozjs-dev wget
- sudo apt-get install libcurl4-gnutls-dev
Next we need to get Erlang 5.6 or above. This is another case where newer releases of Ubuntu have this version, but not Ubuntu 8.04. But this time the Apache folks on the CouchDB project have a nifty solution of using the Ubuntu Intrepid repository to grab the updated version of Erlang. (Chris Strom's blog post Yak Shaving is the new Dependency Hell help deal with a number of dependency issues thrown up by configure)
That's all the dependencies sorted. Now onto downloading the most up-to-date CouchDB source code and building it (this follows the approach documented by Craig R Webster) :
- wget http://mirror.public-internet.co.uk/ftp/apache/couchdb/0.9.1/apache-couchdb-0.9.1.tar.gz
- tar -xzvf apache-couchdb-0.9.1.tar.gz
- cd apache-couchdb-0.9.1
- ./configure
- make && sudo make install
At this point we have a working installed version of CouchDB. Craig continues with some additional work, and even gets couchdb installed as a service that can be started and stopped using the bog-standard Ubuntu init.d methods:
- sudo adduser couchdb
- sudo mkdir -p /usr/local/var/lib/couchdb
- sudo chown -R couchdb /usr/local/var/lib/couchdb
- sudo mkdir -p /usr/local/var/log/couchdb
- sudo chown -R couchdb /usr/local/var/log/couchdb
- sudo mkdir -p /usr/local/var/run
- sudo chown -R couchdb /usr/local/var/run
- sudo cp /usr/local/etc/init.d/couchdb /etc/init.d/
- sudo update-rc.d couchdb defaults
- sudo /etc/init.d/couchdb start
At this point CouchDB is running as a daemon. And we can test it via HTTP by calling the root URL on localhost:
- wget http://localhost:5984/
Wget saves the contents of this url into index.html, and this contains:
{"couchdb":"Welcome","version":"0.9.1"}
And we are done!
Related links
- Tim Huegdon: CouchDB on an Ubuntu Development VM takes us through installing the Ubuntu supplied CouchDB package. Easier install if you don't mind running CouchDB 0.80.
[ Weblog | Categories and feeds | 2011 | 2010 | 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 ]