Thursday, February 2, 2012

Install / Build CouchDB on RHEL 6 & CentOS 6

On RHEL you first need to enable the optional server repo, then install EPEL

Install the prerequisites:
yum install erlang libicu-devel openssl-devel curl-devel make gcc erlang js-devel libtool which
 Grab the CouchDB source from:

Extract the source and enter the source directory
tar xvfz apache-couchdb-1.1.1.tar.gz
cd apache-couchdb-1.1.1

Configure make on x86_x64:
./configure --prefix=/usr/local --enable-js-trunk --with-erlang=/usr/lib64/erlang/usr/include

Configure make on i386:
./configure --prefix=/usr/local --enable-js-trunk
Compile CouchDB
make && make install
Add the CouchDB user and set the log file permissions:
adduser -r --home /usr/local/var/lib/couchdb -M --shell /bin/bash --comment "CouchDB Administrator" couchdb
chown -R couchdb: /usr/local/var/lib/couchdb /usr/local/var/log/couchdb /usr/local/etc/couchdb

*optional* Symlink the init script and config files to the standard locations:
ln -s /usr/local/etc/rc.d/couchdb /etc/init.d/couchdb
ln -s /usr/local/etc/couchdb /etc/couchdb
*optional* If you want to run CouchDB on anything other than or change the port, edit /etc/couchdb/local.ini
port = 5984
bind_address =
Start CouchDB:
/etc/init.d/couchdb start
 *BROKEN* Proxy CouchDB through Apache with mod_proxy:  Edit the appropriate vhost and add something like:
AllowEncodedSlashes On
ProxyPass /couchdb nocanon
ProxyPassReverse /couchdb
Note that I could not get any proxy config to pass all of the tests, possibly because I've been trying to proxy it through a /uri .  See this for more info:

No comments: