Index Next: Command Line & Console

JaxServer Installation

These are step-by-step procedures for installing JaxServer and NodeJS and their requirements. Always check the websites for the latest versions before installing.

Mac OS X

  • Download and install Xcode version 3 or 4
  • Open the OSX terminal (Command+Space, type Terminal, press Return)
  • Download and install OpenSSL (latest was 1.0.0d):
    cd ~/Downloads
    curl -X GET http://www.openssl.org/source/openssl-1.0.0d.tar.gz > openssl-1.0.0d.tar.gz
    tar xfvz openssl-1.0.0d.tar.gz
    sudo mkdir /usr/local
    sudo mv openssl-1.0.0d /usr/local/openssl
    cd /usr/local/openssl
    ./Configure darwin64-x86_64-cc
    
  • Download latest version of NodeJS to ~/Downloads, then type:
    tar xfvz node-*.tar.gz
    cd node-*
    ./configure --dest-cpu=x64 --openssl-libpath=/usr/local/openssl --prefix=~/node
    make install
    export PATH=$PATH:~/node/bin
    
  • Download and install NPM:
    git clone http://github.com/isaacs/npm.git
    cd npm
    make install
    
  • Install NPM module formidable:
    npm install formidable
    
  • Download latest version of JaxServer to ~/Downloads, then type:
    tar xfvz jaxserver-*.tar.gz
    mv jaxserver-* ~/jaxserver
    chmod u+x ~/jaxserver/bin/jax
    export PATH=$PATH:~/jaxserver/bin
    
  • permenantly add NodeJS and JaxServer to your bash $PATH:
    echo export PATH=\$PATH:\~/node/bin:\~/jaxserver/bin >> ~/.bash_profile
    
  • Run "welcome" app:
    jax run welcome
    
  • Test your app at http://localhost:8000
  • Press Control-C to exit
  • Node 0.4.x: To run any app as a background process use nohup and &, and to stop use killall:
    nohup jax run welcome &
    
    killall node
    
  • Node 0.5.x: To run any app as a background process use jax start and jax stop:
    jax start welcome
    
    jax stop welcome
    

Linux

The following is specific to Ubuntu Linux 11.04 but a similar procedure will work on any Linux distribution with some additional dependencies.

  • Install NodeJS/NPM prerequisites:
    sudo apt-get install curl
    sudo apt-get install build-essential
    sudo apt-get install libssl-dev
    sudo apt-get install git-core
    
  • Download latest NodeJS and perform the following commands:
    tar xfvz node-*.tar.gz
    cd node-*
    ./configure --prefix=~/node
    make install
    export PATH=$PATH:~/node/bin
    
  • Download and install NPM:
    git clone http://github.com/isaacs/npm.git
    cd npm
    make install
    
  • Install NPM module formidable:
    npm install formidable
    
  • Download latest version of JaxServer to ~/Downloads, then type:
    tar xfvz jaxserver-*.tar.gz
    mv jaxserver-* ~/jaxserver
    chmod u+x ~/jaxserver/bin/jax
    export PATH=$PATH:~/jaxserver/bin
    
  • permenantly add NodeJS and JaxServer to your bash $PATH:
    echo export PATH=\$PATH:\~/node/bin:\~/jaxserver/bin >> ~/.bash_profile
    
  • Run "welcome" app:
    jax run welcome
    
  • Test your app at http://localhost:8000
  • Press Control-C to exit
  • Node 0.4.x: To run any app as a background process use nohup and &, and to stop use killall:
    nohup jax run welcome &
    
    killall node
    
  • Node 0.5.x: To run any app as a background process use jax start and jax stop:
    jax start welcome
    
    jax stop welcome
    
  • To accept incoming traffic on port 8000, it may be necessary to add an iptables rule:
    sudo iptables -A INPUT -p tcp --dport 8000 -j ACCEPT
    

Windows

Windows is not supported. However new NodeJS Windows binaries are available for experimenting with.

  • Download and install NodeJS windows binary:
  • Download latest version of JaxServer
  • extract jaxserver-*.tar.gz with 7-Zip or other compatible archive software
  • Open DOS Window (search for "cmd.exe"), find where your node executable is, and type the following commands:
    node jaxserver\bin\jax.js run welcome
    

iOS

Warning: Install this software on your iOS device at your own risk

Due to software restrictions, NodeJS and JaxServer can only be installed on an iOS device by jailbreaking the device and installing the Cydia software loader. This is legal but it may void your warranty for the device. Running NodeJS and JaxServer in this fashion poses a security risk should either software be comprimised. Neither NodeJS or JaxServer come with a warranty of any kind. Proceed at your own risk.

  • Visit http://www.jailbreakme.com using Safari on your iOS device
  • Click FREE, then click INSTALL
  • If this jailbreak method does not work, other methods may be required
  • Once installed, open the Cydia application
  • Search for and install OpenSSH
  • Search for and install either APT 0.7 Strict or AptBackup
  • Exit Cydia
  • Download precompiled NodeJS for iOS to ~/Downloads
  • Download latest version of JaxServer to ~/Downloads
  • Find your device's IP Address (Settings -> Wi-Fi -> your network settings)
    • ip address used in this example is 192.168.0.100
  • Open a terminal and SSH into your device, the default password is: alpine
    ssh root@192.168.0.100
  • If the root user password has not been reset, do so now:
    passwd
  • If the mobile user password nas not been reset, do so now:
    passwd mobile
  • Install unix tools:
    apt-get install coreutils dpkg rsync
    
  • In another Terminal window or tab (in MacOS use "Command+T") copy NodeJS and JaxServer to your device using scp:
    cd ~/Downloads
    scp node-v0.4.8-darwin-arm-1.deb root@192.168.0.100:/var/root
    scp jaxserver-*.tar.gz mobile@192.168.0.100:/var/mobile
    exit
    
  • Back to the device's SSH sesssion, install NodeJS using dpkg:
    dpkg -i node-v0.4.8-darwin-arm-1.deb
    
  • Make symlink for the jax script to be installed in the next step:
    ln -s /var/mobile/jaxserver/bin/jax /usr/bin/jax
    
  • Super-user to the mobile user, and extract JaxServer:
    tar xfvz jaxserver-*.tar.gz
    mv jaxserver-* jaxserver
    chmod u+x ~/jaxserver/bin/jax
    
  • Start JaxServer's built-in welcome application:
    jax run welcome --port=80
  • Test the website using a web browser:
  • To run JaxServer as a background process:
    nohup jax run welcome --port=80 &
  • At a later time, use killall to shut down NodeJS (JaxServer's host process):
    killall node

Synchronizing Files to iOS

A more sophisticated way to synchronize a local copy of JaxServer to your iOS device is to use rsync. The rsync program comes installed on most versions of MacOS and Linux. Use the following command to synchronize a local copy of JaxServer and it's files to your iOS device:

rsync -r -a -v -e "ssh -l mobile" --delete ~/jaxserver/ 192.168.0.100:~/
Next: Command Line & Console