Sei sulla pagina 1di 2

Well this was more effort than it should have been.

I have been dabbling with Er


lang for a while, and after struggling with MySQL, Tomcat and JDBC connectors I
was looking for an alternative web-app stack. CouchDB looks to be perfect, altho
ugh sufficiently new that there is not a lot of documentation, both of the books
available right now are OK, but not brilliant. In general I prefer the style of
CouchDB: The Definitive Guide but prefer the examples from Beginning CouchDB. M
y personal preference with programming and software tool books is that they shou
ld provide detailed, hand-held, speak-to-me-like-I-am-an-imbecile walk-throughs
of the most common basic use cases.
Anyhow, CouchApp looks like a great way to develop apps for CouchDB, although do
cumentation is fairly sparse. The main problem I found is that the versions of E
rlang and CouchDB available from repositories for both Ubuntu and Debian are way
behind the cutting edge to the point that the examples in the books won't run.
I found that the best way to set up my CouchApp development environment is to co
mpletely avoid the repositories and build from source in a clean Ubuntu server V
M using the following steps:
* $ apt-get update
* $ apt-get clean
* $ apt-get upgrade
We are going to be building some software so the following tools are useful:
* $ sudo apt-get install build-essential subversion git-core openssh-server
Install Erlang
* $ sudo apt-get build-dep erlang
* $ sudo apt-get install sun-java6-jdk
* $ wget http://www.erlang.org/download/otp_src_R14A.tar.gz
* $ tar zxvf otp_src_R14A.tar.gz
* $ cd otp_src_R14A
* $ ./configure
* $ make && sudo make install
Install CouchDB
* $ sudo apt-get build-dep couchdb
* $ sudo apt-get install xulrunner-dev libicu-dev libcurl4-gnutls-dev libtoo
l
* $ wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org/couchdb/1.0.0/apac
he-couchdb-1.0.0.tar.gz
* $ tar zxvf apache-couchdb-1.0.0.tar.gz
* $ cd apache-couchdb-1.0.0
* $ ./configure
* $ ./configure --with-js-lib=/usr/lib/xulrunner-devel-1.9.2.3/lib --with-js
-include=/usr/lib/xulrunner-devel-1.9.2.3/include
* $ make CouchDB
* $make
* $sudo make install
Final Setup & Running CouchDB
* $ adduser --system --home /usr/local/var/lib/couchdb --no-create-home --sh
ell /bin/bash --group --gecos "CouchDB Administrator" couchdb
* $ sudo chown -R couchdb:couchdb /usr/local/etc/couchdb
* $ sudo chown -R couchdb:couchdb /usr/local/var/lib/couchdb
* $sudo chown -R couchdb:couchdb /usr/local/var/log/couchdb
* $sudo chown -R couchdb:couchdb /usr/local/var/run/couchdb
* $sudo chmod -R 0770 /usr/local/etc/couchdb
* $sudo chmod -R 0770 /usr/local/var/lib/couchdb
* $sudo chmod -R 0770 /usr/local/var/log/couchdb
* $sudo chmod -R 0770 /usr/local/var/run/couchdb
* $ sudo ln -s /usr/local/etc/init.d/couchdb /etc/init.d/couchdb
Running CouchDB Manually
* $ sudo -i -u couchdb couchdb
Running CouchDB As a Daemon
* $ sudo /etc/init.d/couchdb start

Potrebbero piacerti anche