Skip to content
This repository has been archived by the owner on Feb 14, 2018. It is now read-only.

Hosting and Installation Guide

hallahan edited this page Feb 22, 2012 · 27 revisions

#Hosting and Installation Guide

Hosting

If you are interested in hosting a Federated Wiki server farm, you will need to have a dedicated computer that is always connected to the internet. Your options are:

  1. Have a desktop that is always connected to the internet.
  2. Purchase access to a Virtual Cloud Server.
  3. Have access to a web server through your ISP, university, or Hosting Service.
  4. Use a PaaS (Platform as a Service).

Desktop

This option gives you the most control. The disadvantage is that you probably are stuck with using an ISP like Comcast that restricts your upstream bandwidth to around 3-5MBPS. This is fine for a small scale web server, but it will not be enough for serious traffic. If you have a fiber optic connection, you should be fine with this option.

If you are connected through a router, you must go into the settings and open the port in which you intend on running your web server.

Virtual Private Cloud Server

With this option, you will have your own virtual machine instance running on a server in a data center. The advantage here is that you will have root access to your server, your internet connection will be fast, and you will not have to worry about your server being on all the time. There are several disadvantages. Firstly, if you want to pay a low price, you do not get much disk space or RAM. This shoudln't matter much at this point for hosting a Federated Wiki server farm. Also, there is a good chance you will have problems with your server, and it may unexpectedly go down. I am using Rackspace, and this happens relatively often. You will then be dependent on your service's tech support to resolve your problem.

Service Providers:

Server Access through ISP, University, Hosting Service

The main disadvantage here is that you probably will not have root access to the machine. You can still make this work by compiling NodeJS from source and running the server in user space. You get the same functionality, except you will not be able to run the server on port 80, since that requires root access. See the "From Source with No Root Privilege" section for more details.

Use a PaaS (Platform as a Service)

Like this Virtual Cloud Server option, you will have to subscribe to a hosting service provider. You will not have root access, but you will not need it. You will simply upload the Node or Sinatra project to their servers. They will then handle the details of administration and deployment.

Service Providers:

Requirements

This installation guide applies to Linux/Unix machines. It has been tested on Debian GNU/Linux 6.0.3 (Squeeze), Ubuntu 11.10 (Oneiric Ocelot) and Mac OS X 10.6 (Snow Leopard). If you have installed a server farm on a different system, contributions to this guide are welcome.

First, you must have installed Git. This may be downloaded at git-scm.com. If you are using Debian/Ubuntu, type:

sudo apt-get install git

Using NodeJS (Express)

Though NodeJS is not the reference implementation of the Federated Wiki server, it is the easiest method to get a production ready Federated Wiki server farm. You will simply need to install NodeJS and pull the dependencies for the project. When using NodeJS, your Smallest Federated Wiki application is the actual web server, so Apache is not needed.

Using apt-get (Linux)

If you are using Debian, you will need to add the sid package repository.

root@host: ~ # echo deb http://ftp.us.debian.org/debian/ sid main > /etc/apt/sources.list.d/sid.list
root@host: ~ # apt-get update
root@host: ~ # apt-get install nodejs

If you are using Ubuntu, the oneiric universe repository must be included in your aptitude sources list. This will usually already be done for you.

Edit this file:

/etc/apt/sources.list

Add:

deb http://us.archive.ubuntu.com/ubuntu/ oneiric universe
deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric universe
deb http://us.archive.ubuntu.com/ubuntu/ oneiric-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric-updates universe

Then update:

sudo apt-get update

Run Install:

sudo apt-get install nodejs

Clone the Github repository (cd into any directory of your choice):

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

Install the required NodeJS package dependencies:

cd Smallest-Federated-Wiki/server/express
npm install

Now you are ready to run the server. We will be using screen so that the server remains active after you close your terminal window.

cd bin
screen node server.js

When you want to later see the log output of node or terminate your server process, you can get back to your old screen by typing:

screen -raAd

To terminate, type control-c.

From Source With No Root Privilege (Linux/Mac)

You will have to take this option if you do not have root access to your server or you are not using a PaaS. The functionality will be the same with this option, but you will not be able to run the server on port 80 without root access.

This is a fairly involved process, and I plan on providing a standalone .zip with everything you need so that you do not need to take thse steps.

  1. cd into the directory in which you would like to install NodeJS.

  2. Clone the Github repository and install locally:

    git clone https://github.com/joyent/node.git cd node git checkout v0.6.7 ./configure make

  3. Do not run sudo make install. This will attempt to take what you just compiled and put it in system directories. You need root access for this. At this point, you can run node. It will just be the executable called "node" within the directory in which you checked out the repository.

  4. Clone The Smallest Federated Wiki Github repository.

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

  5. Now you will need to get the project's dependencies. Since npm requires root access to be installed, you will have to get your dependencies (node_modules) on a machine that you DO have root access to. So, you will have to install node on that other machine, clone the wiki there, and then run npm install within the directory Smallest-Federated-Wiki/server/express. You then will need to copy the node_modules directory to the Smallest-Federated-Wiki project on the other machine.

  6. It should work now. To run your server, type:

    cd path/to/node screen ./node Smallest-Federated-Wiki/server/express/bin/server.js

  7. When you want to later see the log output of node or terminate your server process, you can get back to your old screen by typing:

    screen -raAd

  8. To terminate, type control-c.

Using WEBrick (Sinatra)

WEBrick is the easier option for setting up a Federated Wiki server farm, but note that this server was never really designed to be used in a production environment.

[TODO]

Using Apache (Sinatra)

Apache is the de-facto standard of web http servers. This is your most robust option for hosting a Sinatra based server farm.

[TODO]

Clone this wiki locally