SFW-RPI

Friday, 15 Feb. 2013

Hosting the Smallest Federated Wiki on a Raspberry Pi

This setup can be used on a Raspberry Pi (model B v.2) with a default raspian installation (Wheezy). 

The installation of SFW with node.js can take several hours on the Raspberry-pi. You can copy/paste the following codes one by one and have a functional SFW setup when finished.

Make sure you can access the Rpi over ssh ... if you need to enable ssh you can run the config with:

sudo raspi-config

(find the ssh entry in the list and enable)

Connect to your Rpi on another pc in a terminal with ssh (you need to know the ip of the Rpi):

ssh pi@your_local_ip

example:

ssh pi@192.168.1.68

(default password is "raspberry")

Once you have access with ssh you should be able to paste the following code's in the terminal one by one and end with a functional SFW hosted on the Raspberry Pi. (on linux copy with: Ctrl-c and paste in the terminal with Ctrl-Shift-v or Ctrl-Shift-insert)

Start here:

cd /

install node.js

sudo apt-get install python g++ make

create a directory for node

mkdir ~/nodejs && cd $_

get the last known compatible node version

wget -N http://nodejs.org/dist/v0.8.23/node-v0.8.23.tar.gz

unpack 

tar xzvf node-v0.8.23.tar.gz && cd node-v0.8.23

configure

./configure

make (this step takes about 2.5 hours ...)

sudo make install

...check if node is installed properly by checking the version:

 node -v

SFW is distributed as a GitHub repository ... so we need to install git

sudo apt-get install git

(follow the instructions and confirm on installation with a "y")

make a directory to install the SFW node app

sudo mkdir  /opt/apps

adjust the rights 

sudo chmod -R 775 /opt/apps/

make the user a member ("pi" the user)

sudo chown ${USER}:pi -R /opt/apps/

cd to opt/apps

cd opt/apps

get the SFW repo with git

git clone https://github.com/WardCunningham/Smallest-Federated-Wiki.git

cd to server/express 

cd Smallest-Federated-Wiki/server/express

install with npm

npm install

go to bin

cd bin

Start SFW

node server.js

visit SFW in a browser on another pc with the local ip you use for the Raspberry pi and add the default port :3000

example:

192.168.1.68:3000

In the terminal you can stop SFW again by typing Ctrl-C


This tutorial is also published on the SFW project Wiki

Follow this guide to run SFW as a deamon: Autostart SFW-RPI