sudo apt-get update -y
sudo apt-get install git-core build-essential -y
curl -O http://nodejs.org/dist/v0.10.17/node-v0.10.17.tar.gz
tar -zxvf node-v0.10.17.tar.gz
cd node-v0.10.17
./configure
make
sudo chown -R ubuntu /usr/local
make install
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
sudo apt-get update -y
sudo apt-get install g++ -y
sudo apt-get install erlang-base erlang-dev erlang-eunit erlang-nox -y
sudo apt-get install libmozjs185-dev libicu-dev libcurl4-gnutls-dev libtool -y
curl -O http://apache.mirrors.tds.net/couchdb/source/1.3.1/apache-couchdb-1.3.1.tar.gz
tar -zxvf apache-couchdb-1.3.1.tar.gz
cd apache-couchdb-1.3.1
./configure
make
sudo make install
sudo adduser --disabled-login --disabled-password --no-create-home couchdb
sudo chown -R couchdb:couchdb /usr/local/var/log/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/lib/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/run/couchdb
sudo ln -s /usr/local/etc/init.d/couchdb /etc/init.d
sudo update-rc.d couchdb defaults