Skip to content

Server on Ubuntu x86

cjdaly edited this page Feb 25, 2014 · 36 revisions

Updated 24-Feb-2014

Moved server-setup.sh script down into directory with Sinatra server code.

Initial hardware and OS setup

I used VMWare workstation (easy install) to create a VM based on the ubuntu-12.04.1-desktop-amd64 ISO image.

In the VM settings, check the Network Adapter connection type. This may have defaulted to NAT. Set it to Bridged (but don't need to check the Replicate physical network connection state option). This makes the VM-based server visible to client systems on the LAN.

After the initial OS installation, do the following in a terminal:

sudo apt-get update
sudo apt-get install git

Also need to increase open files limit (ulimit -n) for Neo4j. Edit /etc/security/limits.conf and add lines like this, replacing 'userid' with the userid you will use to run the Napkin server:

userid hard nofile 40000
userid soft nofile 40000

Reboot the system after editing the limits.conf file for the changes to take effect.

Java setup

Get the Server JRE download from the Oracle Java site.

cd ~
mkdir java
cd java
tar xvf server-jre-7u45-linux-x64.tar.gz

JRuby setup (part 1)

cd ~
mkdir jruby
cd jruby
wget -O jruby-bin-1.7.9.tar.gz 'http://jruby.org.s3.amazonaws.com/downloads/1.7.9/jruby-bin-1.7.9.tar.gz'
tar xvf jruby-bin-1.7.9.tar.gz

Neo4j setup

cd ~
mkdir neo4j
cd neo4j
wget -O neo4j-community-2.0.0.tgz 'http://download.neo4j.org/artifact?edition=community&version=2.0.0&distribution=tarball'
tar xvf neo4j-community-2.0.0.tgz

Clone Napkin

Next, clone the napkin code from github:

cd ~
git clone https://github.com/cjdaly/napkin.git

Now add java, neo4j and jruby to the path, and confirm each one gives a reasonable version/status message.

source ~/napkin/server/sinatra/server-setup.sh

JRuby setup (part 2)

Install gems used by Napkin:

gem install --no-rdoc --no-ri rest-client sinatra json kramdown

Typical startup

cd ~/napkin/server/sinatra
source server-setup.sh
./napkin.sh -start systems/ubuntu-x86
tail -f napkin.log

Typical shutdown

./napkin.sh -status
./napkin.sh -stop