so, one of the packages i've recently come to love is
node.js. it can be described simply as "a javascript based web server." but it's probably more correct to call it a "
google V8 based framework for building javascript based networked applications."
the distinction is important 'cause some people coming to node from
apache or
nginx may think you can install it, add a html page somewhere and start looking for it to be automagically served. one of the first things you learn about node is it really is a web application toolkit. out of the box, you have to write code to make it do things; even simple things like serving up static html files.
this sort of makes node a tool for people unafraid to roll up the sleeves and write some JavaScript code. and while these people are usually not scared off by having to download and compile packages from source, it can be a chore sometimes. it's even worse if you've configured your development environment with specific package versions that don't (for whatever reasons) play well with node.
so... to help spread the node gospel, i started building pre-configured
virtualbox appliances based on debian with node and
mongodb already installed and configured, ready to go. the idea is, you download and install virtualbox, then download the development appliance, add a name and password and you can start developing node applications. this appliance includes the following packages:
- debian lenny (v5.0.9)
- node.js 0.6.6
- npm (the node package manager)
- express.js (a respected framework for building node.js web-apps)
- nginx 1.0.11 (used as a reverse proxy)
- mongodb
if this is something you're interested in, read on!
step 1 : downloading virtualbox
downloading virtualbox is pretty straight-forward. go to http://www.virtualbox.org/, click on the download link and then download and install the package appropriate for your system.
step 2 : download the appliance
the appliance is shipped as a "dot ova" file; this is a standard format for distributing virtual machines. be careful, these files can be big, usually around 600 to 700 megabytes. please don't download them on a 56k modem. i host the virtual appliance files on my system in santa cruz, ca (thank you, cruzio.) if you would like to mirror the files, please do so. the licenses involved shouldn't require you to get my permission prior to providing a mirror, but please send me an email at OhMeadhbh@gmail.com so i know people are interested.
step 3 : think long and hard about installing the appliance
the appliance should be pre-configured to not open any ports on a public network. it will, however, open several on virtualbox's "host only" network. the appliance launches the openssh and samba servers at boot time. it also hosts a simple configuration app on the host only network at port 2525. i have made reasonable efforts to ensure these services are available only on the "host only" interface. but i'm human, i make mistakes. this appliance is provided without guarantee of suitability for any particular use.
you probably also want to review the licenses of the packages i've added to the build.
if you have reason to believe this appliance may introduce a security vulnerability or you can't abide by the license terms, don't install it.
step 4 : install and start the appliance
installing the appliance is easy enough; from the "oracle vm virtualbox manager" window, click the "File > Import Appliance..." menu item. virtual box will ask you where to find the .ova file you downloaded in step 2. after that, return to the "oracle vm virtualbox manager" window, highlight the appliance and click on the big green "start" arrow at the top of the window.
step 5 : configure the appliance
before using the appliance, we have to create a developer account.
open your browser and point it towards http://helium.l.nodify.us:2525/. this will bring you to the configuration page where you'll need to enter a username and password. please do not reuse a password you use on another system. if you have a ssh rsa public key, you may enter it in the space provided. if you enter a key here, it will be appended to the "authorized_keys" file in the newly created user's ~/.ssh directory. if you don't know what that is, don't worry, it's not required.
step 6 : login and enjoy
congratulations! you now have a working node.js instance ready for you to play with. you should be able to use your newly created account credentials to log in via openssh or to mount your home directory on the appliance as a SMB share. node applications running on the appliance should only be visible via the "host only" network. i've configured the following DNS records that should point to IP addresses of interest to the appliance. this means they can be used as targets for openssh, samba and your browser.
| host name | ip address | notes |
| hydrogen.l.nodify.us | 192.168.56.1 | the host machine's "host only" IP address |
| helium.l.nodify.us | 192.168.56.2 | IP address for the node appliance |
| lithium.l.nodify.us | 192.168.56.3 | reserved for future use |
| beryllium.l.nodify.us | 192.168.56.4 | reserved for future use |
linux or MacOS users can open a terminal and use this command to login:
ssh <username>@helium.l.nodify.us
windows users can use any ssh client, thought PuTTY seems to be a popular choice.
step 7 : questions? comments?
i'm interested in what peeps think about this project. feel free to contact me at OhMeadhbh@gmail.com with questions or comments.
please feel free to reuse this appliance as you see fit. the bits i wrote are distributed with a BSD open source license. other components are released under open source licenses. for the curious, i've listed the steps i take to build this appliance on the "build your own node appliance" page.