Skip to content

Install and run on RPM based Linux Distributions

davcamer edited this page Mar 24, 2011 · 1 revision

General Notes:

(Installing Ruby from source because 1.8.7 isn’t available from the package manager on CentOS)

When installing on your local machines for development purposes, it might be easier to install pre-compiled binaries for Ruby and CouchDB, for instance.

Step 0: Make sure GCC is available!

(CentOS box, so had to do a sudo yum install gcc)
Also had to pull down the zlib and openssl development headers for Ruby gems to work properly, sudo yum install zlib-devel openssl openssl-devel

Step 1: Install Ruby 1.8.7 (with openssl support)

curl ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz > ruby-1.8.7.tar.gz

tar xzf ruby-1.8.7.tar.gz

cd ruby-1.8.7-p174

./configure

ruby ext/openssl/extconf.rb

make

sudo make install

Do a ruby -v to make sure that the 1.8.7 version is being picked up.

Step 2: Install Rubygems

wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz

tar xzf rubygems-1.3.5.tgz

cd rubygems-1.3.5

ruby setup.rb

Step 3. Install Rails using Rubygems

sudo gem install rails -v '2.3.5' (Check syntax….)

Also install the json, rspec and cucumber gems
sudo gem install json rspec cucumber

Step 4. Install CouchDB

Install the prerequisites (hmm, there are a lot of these!). Hopefully this will be easier on other systems.
After some Googling on ‘CentOS couchdb install’ I found I needed the following
sudo yum install ncurses-devel openssl-devel icu libicu-devel js js-devel curl-devel erlang erlang-devel libtool

cd src

wget http://www.mirrorservice.org/sites/ftp.apache.org/couchdb/0.10.1/apache-couchdb-0.10.1.tar.gz

tar xzf apache-couchdb-0.10.1.tar.gz

./configure --with-erlang=/usr/lib64/erlang/usr/include # The path will most likely be different on a non-CentOS machine

make

sudo make install

Because we’re running on UNIX we’ll want to set up a separate user account for running couchdb:
sudo adduser -r -d /usr/local/var/lib/couchdb couchdb

chown -R couchdb /usr/local/var/lib/couchdb

chown-R couchdb /usr/local/var/log/couchdb

chown-R couchdb /usr/local/var/run/couchdb

Now we should be able to start it as a Daemon:
sudo/usr/local/etc/rc.d/couchdb start

Awesome!

CouchDB should now be running on http://localhost:5984
You should also be able to see the built-in database admin tool, Futon, on http://localhost:5984/_utils/