From Cobalt Partdridge, 9 Years ago, written in Plain Text.
Embed
  1. ================================================================================
  2. # Install CouchDB Database on Pi-2 Running Raspbian Jessie
  3. # These instructions are based on those found on this web page:
  4.  
  5. ( http://jeeonthepi.blogspot.com/2015/09/installing-couchdb-161-on-raspberry-pi.html )
  6. ==========================================================================================
  7.  
  8. ##########################################################################################
  9. Install Erlang (https://www.erlang-solutions.com/downloads/download-erlang-otp)
  10. ##########################################################################################
  11.  
  12. # 1. Adding repository entry
  13.  
  14. # Add the following line to your /etc/apt/sources.list:
  15.  
  16.         $ wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
  17.          
  18.         $ sudo dpkg -i erlang-solutions_1.0_all.deb
  19.        
  20.         ## when prompted enter "jessie"
  21.        
  22.         $ sudo nano /etc/apt/sources.list
  23.  
  24. # Uncomment line below and save the file:
  25.  
  26.         #deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
  27.  
  28.         $ sudo apt-get update
  29.  
  30. # Next, add the Erlang Solutions public key for apt-secure using following commands:
  31.  
  32.         $ wget http://packages.erlang-solutions.com/debian/erlang_solutions.asc
  33.         $ sudo apt-key add erlang_solutions.asc
  34.  
  35. # 2. Installing Erlang
  36.  
  37. # Refresh the repository cache and install the erlang package.
  38.  
  39.         $ sudo apt-get update
  40.         $ sudo apt-get install erlang
  41.  
  42. # Development headers for spidermonkey lib
  43.  
  44.         $ sudo apt-get install libmozjs185-dev
  45.  
  46. # Dev files for libcurl (openSSL)
  47.  
  48.         $ sudo apt-get install libcurl4-openssl-dev
  49.  
  50. # Dev files for icu (Unicode and Locales)
  51.  
  52.         $ sudo apt-get install libicu-dev
  53.  
  54. # Most of this below is needed to install the CouchDB Documentation (as far as I know)
  55.  
  56.         $ sudo apt-get install help2man
  57.  
  58.         $ sudo apt-get install install-info
  59.  
  60.         $ sudo apt-get install texlive-latex-base
  61.        
  62.         $ sudo apt-get install texlive-pictures
  63.  
  64.         $ sudo apt-get install python-pygments 
  65.  
  66.         $ sudo apt-get install python-sphinx
  67.  
  68.         $ sudo apt-get install texinfo
  69.  
  70. ##########################################################################################
  71. Create couchDB user account
  72. ##########################################################################################
  73.  
  74.         $ sudo useradd -d /var/lib/couchdb couchdb
  75.  
  76.         $ sudo mkdir -p /usr/local/{lib,etc}/couchdb /usr/local/var/{lib,log,run}/couchdb /var/lib/couchdb
  77.  
  78.         $ sudo chown -R couchdb:couchdb /usr/local/{lib,etc}/couchdb /usr/local/var/{lib,log,run}/couchdb
  79.  
  80.         $ sudo chmod -R g+rw /usr/local/{lib,etc}/couchdb /usr/local/var/{lib,log,run}/couchdb
  81.  
  82. ##########################################################################################
  83. Install CouchDB
  84. ##########################################################################################
  85.  
  86. # Download source and unpack
  87.         $ wget http://ftp-stud.hs-esslingen.de/pub/Mirrors/ftp.apache.org/dist/couchdb/source/1.6.1/apache-couchdb-1.6.1.tar.gz
  88.  
  89.         $ tar xzf apache-couchdb-*.tar.gz
  90.  
  91. # Change into the couchDB directory
  92.  
  93.         $ cd apache-couchdb-1.6.1
  94.  
  95. #Configure the build
  96.  
  97.         $ ./configure --prefix=/usr/local --with-js-lib=/usr/lib --with-js-include=/usr/include/js --enable-init
  98.  
  99. # running make and make install
  100.  
  101.         $ make && sudo make install
  102.  
  103. # Install hung here:
  104.  
  105. ! Font T1/cmr/m/n/10=ecrm1000 at 10.0pt not loadable: Metric (TFM) file not fou
  106. nd.
  107. <to be read again>
  108.                                    relax
  109. l.100 \fontencoding\encodingdefault\selectfont
  110.                                                                                          
  111. ?
  112.  
  113. # I just hit "return" and it finished up...
  114.  
  115. ##########################################################################################
  116. # Start couchDB
  117. ##########################################################################################
  118.  
  119.         $ sudo ln -s /usr/local/etc/init.d/couchdb /etc/init.d/couchdb
  120.  
  121.         $ sudo /etc/init.d/couchdb start
  122.  
  123.         $ sudo update-rc.d couchdb defaults
  124.  
  125. # see if its running...
  126.  
  127.         $ curl http://127.0.0.1:5984/
  128.  
  129. # If it is running you'll see a message like this:
  130.  
  131. {"couchdb":"Welcome","uuid":"ca6622aa3e676b51ef8245ae473454cb","version":"1.6.1","vendor":{"version":"1.6.1","name":"The Apache Software Foundation"}}
  132.  
  133. ##########################################################################################
  134. # Configure couchDB
  135. ##########################################################################################
  136.  
  137. # Open local.ini:
  138.  
  139.         $ sudo nano /usr/local/etc/couchdb/local.ini
  140.  
  141. # Find the [httpd] section, uncomment the port
  142. # and bind_address and set the bind_address to the IP of
  143. # your Pi to make couchDB accessible within your network
  144.  
  145.         [httpd]
  146.         port = 5984
  147.         bind_address = YOUR_IP_ADDRESS
  148.  
  149. # Example:      bind_address = 192.168.0.211
  150.  
  151. # make couchdb user (created above) owner of local ini-file
  152.  
  153.         $ sudo chown couchdb:couchdb /usr/local/etc/couchdb/local.ini
  154.  
  155. # re-boot your Pi and open Futon in your web browser:
  156.  
  157.         $ sudo reboot
  158.  
  159.         $ sudo /etc/init.d/couchdb start
  160.  
  161.  
  162. #       YOUR_IP_ADDRESS:5984/_utils/
  163.  
  164. #       example: http://192.168.0.211:5984/_utils/
  165.  
  166. # Or try the new "Fauxton" interface:
  167. #       example: http://192.168.0.211:5984/_utils/fauxton/
  168.  
  169. # To Restart CouchDB
  170.  
  171.         $ sudo pkill -f couchdb
  172.         $ sudo /etc/init.d/couchdb restart
  173.  
  174. # Enabling CORS on CouchDB
  175.  
  176.         $ npm install -g add-cors-to-couchdb
  177. #       $ add-cors-to-couchdb
  178.         $ add-cors-to-couchdb http://192.168.0.211 -u pi -p pi
  179.  
  180. ================================================================================
  181. # Pi-2 Node.js
  182.  
  183. (https://learn.adafruit.com/node-embedded-development/installing-node-dot-js)
  184. ================================================================================
  185.  
  186. $ curl -sLS https://apt.adafruit.com/add | sudo bash
  187.  
  188. $ sudo apt-get install node
  189.  
  190. $ node -v
  191.  
  192. ================================================================================
  193. # That's all a got!
  194.  
  195. ##### =========================================================================