WebFaction
Community site: login faq
2
5

I was wondering if it was possible to install couchdb. I saw a procedure to install mongodb but not couchdb. I try to compile it but it seems to be missing a lot of it dependencies.

Any chance someone has succeed to install it?

asked 12 Nov '10, 14:55

matchfwd
41158
accept rate: 0%


Here is an updated install guide using CouchDB 1.1.1 .

You can run these commands individually, or you can paste them into a shell script and run it as

bash buildcouch.sh | tee buildcouch.log

Either way, you may want to run it in a screen session.

export PATH="$HOME/bin:$PATH"
mkdir -p $HOME/src

# Erlang R15B - source: http://www.erlang.org/download/otp_src_R15B.tar.gz
cd $HOME/src
wget 'http://mirror.ryansanden.com/couchdb-1.1.1/otp_src_R15B.tar.gz'
tar -xzf otp_src_R15B.tar.gz
cd otp_src_R15B
./configure --prefix=$HOME
make           # 3 min
make install

# icu 4.8.1.1 - source: http://download.icu-project.org/files/icu4c/4.8.1.1/icu4c-4_8_1_1-src.tgz
cd $HOME/src
wget 'http://mirror.ryansanden.com/couchdb-1.1.1/icu4c-4_8_1_1-src.tgz'
tar -xzf icu4c-4_8_1_1-src.tgz
cd icu/source
./configure --prefix=$HOME
make           # 1.5 min
make install

# spidermonkey 1.8.5 - source: http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
cd $HOME/src
wget 'http://mirror.ryansanden.com/couchdb-1.1.1/js185-1.0.0.tar.gz'
tar -xzf js185-1.0.0.tar.gz
cd js-1.8.5/js/src
./configure --prefix=$HOME
make           # 1 min
make install

# curl 7.24.0 - source: http://curl.haxx.se/download/curl-7.24.0.tar.gz
cd $HOME/src
wget 'http://mirror.ryansanden.com/couchdb-1.1.1/curl-7.24.0.tar.gz'
tar -xzf curl-7.24.0.tar.gz
cd curl-7.24.0
./configure --prefix=$HOME
make           # 0.3 min
make install

# make sure we're using the binaries in $HOME/bin and not a cached path
hash -r

# couchdb 1.1.1 - source: http://apache.mirrors.tds.net//couchdb/1.1.1/apache-couchdb-1.1.1.tar.gz
cd $HOME/src
wget 'http://mirror.ryansanden.com/couchdb-1.1.1/apache-couchdb-1.1.1.tar.gz'
tar -xzf apache-couchdb-1.1.1.tar.gz
cd apache-couchdb-1.1.1
export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
export CURL_CONFIG=$HOME/bin/curl-config
./configure --prefix=$HOME --with-js-lib=$HOME/lib --with-js-include=$HOME/include/js --with-erlang=$HOME/lib/erlang/usr/include
make           # 0.3 min
make install

You can set the port number to use in $HOME/etc/couchdb/local.ini, replacing 5984 with the port you are using and uncommenting that line. 5984 is the default port for couchdb, and it's recommended to create a new Custom Application (listening on port) application in the Control Panel to reserve a new port and then use that one instead.

You can start couchdb in the background (as a daemon) by running "couchdb -b". Make sure to first run it as simply "couchdb" (in the foreground) to make sure it runs without crashing.

You can test it by running:

curl http://127.0.0.1:5984/

replacing 5984 with your assigned port number (set in the $HOME/etc/local.ini file).

The URI of your couchdb instance is stored (for convenience) in $HOME/var/run/couchdb/couch.uri and the PID of the process in $HOME/var/run/couchdb/couchdb.pid

Connect to Futon by creating an SSH tunnel to connect to the database. Then, point your browser (Firefox officially supported) at http://127.0.0.1:5984/_utils/ (again replacing 5984 with your port number). Note that connecting via SSH tunnel causes some of the tests in the Test Suite to fail, but it's nothing to worry about.

Data is stored in $HOME/var/lib/couchdb. Deleting everything in this directory and restarting couchdb will restore your server to a clean, empty state (don't forget the hidden files).

Hope that helps!

permanent link
This answer is marked "community wiki".

answered 17 Jun '11, 21:14

ryans ♦♦
5.0k93159
accept rate: 43%

wikified 16 Feb '12, 12:21

seanf
12.2k31836

i followed every step and it worked, then (after night) couchdb was down and every attempt to restart it had this report:

=INFO REPORT==== 20-Sep-2011::10:12:06 ===
    application: couch
    exited: {bad_return,{{couch_app,start,
                                    [normal,
                                     ["/home/dsgn/etc/couchdb/default.ini",
                                      "/home/dsgn/etc/couchdb/local.ini"]]},
                         {'EXIT',"libicuuc.so.42: cannot open shared object file: No such file or directory"}}}
    type: temporary

I also tried to reinstall (and update) icu, but without any luck. could you help me?

(20 Sep '11, 03:17) cedmax

You need to use:

export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH

again before trying to restart CouchDB.

(20 Sep '11, 03:27) neeravk

you rock!! do I have to do it every time that couch goes down? is there any way to avoid it? should I install monit or something like that?

thanks again

(20 Sep '11, 03:40) cedmax

You could just add the line to your ~/.bash_profile line which getes executed every time you login using SSH.

You can add a line to your crontab to restart it too using:

19,39,59 * * * * export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH; start-command

(20 Sep '11, 03:47) neeravk

Worth noting for other users who encounter the issue - Erlang headers not found (solution below):

checking for erl... /home/netpoetica/bin/erl
checking for erlc... /home/netpoetica/bin/erlc
checking erl_driver.h usability... no
checking erl_driver.h presence... no
checking for erl_driver.h... no
configure: error: Could not find the `erl_driver.h' header.

Are the Erlang headers installed? Use the `--with-erlang' option to specify the
path to the Erlang include directory.

I got this error on MacOSX 10.6.8 using TotalTerminal plugin to plain old terminal. Looks like it doesn't like not having a slash (/) after the directory in the instructions as per the guide (where it's missing in multiple places).

# couchdb 1.1.1 - source: http://apache.mirrors.tds.net//couchdb/1.1.1/apache-couchdb-1.1.1.tar.gz
./configure --prefix=$HOME --with-js-lib=$HOME/lib --with-js-include=$HOME/include/js --with-erlang=$HOME/lib/erlang/usr/include

Simply replace the configure line with:

./configure --prefix=$HOME --with-js-lib=$HOME/lib/ --with-js-include=$HOME/include/js/ --with-erlang=$HOME/lib/erlang/usr/include/

Worked perfectly for me

(03 Nov '12, 10:06) netpoetica

Any advice about how to update Erlang, couch, etc, having used this method? Looks like erlang is a few versions behind and it's behaving a little wildly for me

(09 Aug '13, 19:34) netpoetica

It should be simple to install newer versions using the same basic procedure, in the same order as this guide uses. Are you seeing any problems we might be able to address?

(09 Aug '13, 20:59) ryans ♦♦

I tried to install a new version of erlang - this made couch serve 502 bad gateway - reinstalled version from this toot, still getting bad gateway. Running couchdb immediately kills it and sends no error to stderr.

(10 Aug '13, 00:55) netpoetica

Well, you won't be able to just install a newer erlang without recompiling everything else, because you're linking against shared libraries which need to match the versions they were compiled against. Do you perhaps mean that you've reinstalled the entire stack and are seeing this behavior?

(10 Aug '13, 03:35) ryans ♦♦

Hey Ryans - I tried reinstalling from your script and encountered this error - I imagine something to do with the fact that couch has already been installed, but it's very difficult to decipher this error message:

make[1]: Entering directory `/home/netpoetica/src/apache-couchdb-1.3.1/src'
Making install in couch_index
make[2]: Entering directory `/home/netpoetica/src/apache-couchdb-1.3.1/src/couch_index'
/home/netpoetica/bin/erlc -I../../src/couchdb -o ebin/   src/couch_index.erl;
src/couch_index.erl:none: internal error in parse_module;
crash reason: {undef,[{epp,read_encoding,["src/couch_index.erl"],[]},
                  {compile,parse_module,1,
                           [{file,"compile.erl"},{line,783}]},
                  {compile,'-internal_comp/4-anonymous-1-',2,
                           [{file,"compile.erl"},{line,276}]},
                  {compile,fold_comp,3,[{file,"compile.erl"},{line,294}]},
                  {compile,internal_comp,4,
                           [{file,"compile.erl"},{line,278}]},
                  {compile,'-do_compile/2-anonymous-0-',2,
                           [{file,"compile.erl"},{line,152}]}]}
make[2]: *** [ebin/couch_index.beam] Error 1
make[2]: Leaving directory `/home/netpoetica/src/apache-couchdb-1.3.1/src/couch_index'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/netpoetica/src/apache-couchdb-1.3.1/src'
make: *** [install-recursive] Error 1
(10 Aug '13, 08:57) netpoetica

Newbie but when I ran the build script and set a custom port (from a Webfaction custom application with a new port), I couldn't get Curl to connect ("Couldn't connect to host.")

Checking the /var/run directory, I just found a .pid but not a .uri. I wonder if I have configured it wrong?

(02 Oct '15, 19:26) JohnGoren

JohnGoren, I killed and started your couchdb instance to see if it would report any errors and it did,

{'EXIT',"libicuuc.so.48: cannot open shared object file: No such file or directory"}}}

You will have to resolve any errors it is generating before you damonize it for it to work.

The above error can be solved by setting the lib directory path (since libicuuc.so.48 does exist, but the path is not set by shell,

[you@server ~]$ export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
[you@server ~]$ couchdb
Apache CouchDB 1.1.1 (LogLevel=info) is starting.
Apache CouchDB has started. Time to relax.
[info] [<0.31.0>] Apache CouchDB has started on       http://127.0.0.1:23098/

After doing this I was able to curl on that port and it worked.

(02 Oct '15, 22:24) johns ♦♦
showing 5 of 12 show 7 more comments

Instructions for building CouchDB are available here: http://forum.webfaction.com/viewtopic.php?pid=12182#p12182

permanent link

answered 12 Nov '10, 15:08

seanf
12.2k31836
accept rate: 37%

Thank you for the quick and relevant answer.

(12 Nov '10, 19:08) matchfwd

You're very welcome!

(12 Nov '10, 19:10) seanf

Does CouchDB have any 32bit limitations like MongoDB, by any chance?

(02 Aug '11, 11:29) hacksparrow

THese instructions worked fine for me. However, I also tried adding a command to cron to ensure the process restarts if the process dies. A previous thread intimated that couchdb is clever enough to ignore a start command if it is currently started. However, last week I could not SSH into my account because I was using the max 200 processes allocated per user, so I don't think couchdb is that smart.

About to read up on 'monit' as an alternative solution

(05 Jan '12, 04:25) howieweiner

You can check your currently running threads (the limit actually applies to threads, not processes) by running ps -m -u username. I doubt couchdb is responsible for all those. You can also open a ticket about this, so we can check.

(05 Jan '12, 05:41) todork

As usual ... great instructions from the 'faction.

Only issue -- not really related to the instructions -- was that the couchdb file:

apache-couchdb-1.1.1/src/couchdb/priv/couch_js/utf8.h

...needed to be edited.

I had to add newlines at the end and then do the make && make install ...

permanent link

answered 16 Feb '12, 10:57

petty
111
accept rate: 0%

How do you mean needed to be edited? I'm having the same problem. thanks

(15 Mar '12, 15:45) pkanane

:) you literally meant add newlines..smh.. thanks (for the confused i opened the utf8.h file in vim and entered blank new lines- 2 actually)

(15 Mar '12, 15:53) pkanane

What was the error you got if you didn't change this?

(10 Aug '13, 17:00) netpoetica

I've been having problems installing couchdb 1.4.0 and finally solved it. I had been having problems with both memory usage during the install. Thanks to Tim G. from webfaction support for pointing out that I could use nice with the makes.

Anyhow here is an updated buildcouch.sh that installs couchdb 1.4.0 and does it without using to much memory or processor.

rt PATH="$HOME/bin:$PATH" 
mkdir -p $HOME/src

# Erlang R15B - source: http://www.erlang.org/download/otp_src_R15B.tar.gz 
cd $HOME/src 
wget 'http://mirror.ryansanden.com/couchdb-1.1.1/otp_src_R15B.tar.gz' 
tar -xzf otp_src_R15B.tar.gz 
cd otp_src_R15B 
./configure --prefix=$HOME 
nice -n 19 make 
nice -n 19 make install

# icu 4.8.1.1 - source: http://download.icu-project.org/files/icu4c/4.8.1.1/icu4c-4_8_1_1-src.tgz
cd $HOME/src
wget 'http://mirror.ryansanden.com/couchdb-1.1.1/icu4c-4_8_1_1-src.tgz'
tar -xzf icu4c-4_8_1_1-src.tgz
cd icu/source
./configure --prefix=$HOME
nice -n 19 make
nice -n 19 make install

# spidermonkey 1.8.5 - source: http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
cd $HOME/src
wget 'http://mirror.ryansanden.com/couchdb-1.1.1/js185-1.0.0.tar.gz'
tar -xzf js185-1.0.0.tar.gz
cd js-1.8.5/js/src
./configure --prefix=$HOME
nice -n 19 make
nice -n 19 make install

# curl 7.24.0 - source: http://curl.haxx.se/download/curl-7.24.0.tar.gz
cd $HOME/src
wget 'http://mirror.ryansanden.com/couchdb-1.1.1/curl-7.24.0.tar.gz'
tar -xzf curl-7.24.0.tar.gz
cd curl-7.24.0
./configure --prefix=$HOME
nice -n 19 make
nice -n 19 make install

# make sure we're using the binaries in $HOME/bin and not a cached path
hash -r

# couchdb 1.4 - source: http://mirror.symnds.com/software/Apache/couchdb/source/1.4.0/apache-couchdb-1.4.0.tar.gz
cd $HOME/src
wget http://mirror.symnds.com/software/Apache/couchdb/source/1.4.0/apache-couchdb-1.4.0.tar.gz
tar -xzf apache-couchdb-1.4.0.tar.gz
cd apache-couchdb-1.4.0
export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
export CURL_CONFIG=$HOME/bin/curl-config
./configure --prefix=$HOME --with-js-lib=$HOME/lib --with-js-include=$HOME/include/js --with-erlang=$HOME/lib/erlang/usr/include
nice -n 19 make
nice -n 19 make install
permanent link

answered 03 Oct '13, 08:44

tablackmore
33
accept rate: 0%

edited 03 Oct '13, 08:45

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×102
×47
×13

question asked: 12 Nov '10, 14:55

question was seen: 12,954 times

last updated: 02 Oct '15, 22:24

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM