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: http://couchdb.apache.org/downloads.html

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 127.0.0.1 or change the port, edit /etc/couchdb/local.ini
port = 5984
bind_address = 0.0.0.0
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 http://127.0.0.1:5984 nocanon
ProxyPassReverse /couchdb http://127.0.0.1:5984
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: http://wiki.apache.org/couchdb/Apache_As_a_Reverse_Proxy


No comments: