#pragma section-numbers 3 == What is Node.js == Node.js is an application server based off of Google's V8 Javascript Engine. Quite a few popular frameworks have popped up around Node.js such as AngularJS and Backbone.js. == How == === Request a port === Request a !ProxiedServer port on bog as described in FirewallRules === Get Node.js === Make a directory for your website {{{#!highlight bash mcarberry@bog:~$ mkdir ~/public_web/sitename mcarberry@bog:~$ mkdir ~/public_web/sitename/nodejs mcarberry@bog:~$ cd ~/public_web/sitename }}} Download Node.js {{{#!highlight bash mcarberry@bog:~/public_web/sitename$ wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz mcarberry@bog:~/public_web/sitename$ tar -xf node-v0.10.26.tar.gz mcarberry@bog:~/public_web/sitename$ cd node-v0.10.26/ }}} === Build Node.js === {{{#!highlight bash mcarberry@bog:~/public_web/sitename/node-v0.10.26$ ./configure mcarberry@bog:~/public_web/sitename/node-v0.10.26$ make mcarberry@bog:~/public_web/sitename/node-v0.10.26$ make install DESTDIR=~/public_web/sitename/nodejs }}} Cleanup Install Directory {{{#!highlight bash mcarberry@bog:~/public_web/sitename/node-v0.10.26$ cd ../nodejs/ mcarberry@bog:~/public_web/sitename/nodejs$ cp -r usr/local/* . mcarberry@bog:~/public_web/sitename/nodejs$ rm -r usr mcarberry@bog:~/public_web/sitename/nodejs$ cd .. mcarberry@bog:~/public_web/sitename$ rm -r node-v0.10.26/ }}} === Test Install === Change the port in this script (gleaned from [[http://howtonode.org/how-to-install-nodejs|here]]) to the one requested in the firewall rules and place it in ~/public_web/sitename/. {{{#!highlight js var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Node.js\n'); }).listen(8124, "127.0.0.1"); console.log('Server running at http://127.0.0.1:8124/'); }}}