Skip to content
neumark edited this page Mar 26, 2011 · 21 revisions

Getting started with postlock

As with any complex piece of software, getting postlock’s dependencies working can be a daunting task for novices. If you want to try out postlock as quickly as possible, download the virtualbox image. If you want to install postlock natively, please read the corresponding section of this guide. Please contribute installation instructions for other operating systems if you can!

Downloading the virtualbox image

There is a virtualbox image with ubuntu 10.10 and postlock pre-installed. The image can be downloaded from 1fichier.com. Please check the md5 of the image against this checksum before use. The archive can be uncompressed with 7zip.

Installing natively on ubuntu linux

Fetching the postlock source

sudo apt-get install git erlang

mkdir ~/git; cd ~/git; git clone git://github.com/postlock/postlock.git

Installing yaws

First, we need to download yaws (the version packaged with ubuntu 10.10 is obsolete).

cd ~/Downloads

wget http://yaws.hyber.org/download/yaws-1.89.tar.gz

tar -zxvf yaws-1.89.tar.gz; cd yaws-1.89

Second, we need to configure and install yaws from source

./configure --prefix=/home/postlock/opt --localstatedir=/home/postlock/opt/var --sysconfdir=/home/postlock/opt/etc --disable-pam; make; make install

There is a module for yaws called yapp, which we also need. To install yapp, run:

cd applications/yapp;make;make install

Configuring yaws

The yaws configuration lives in /home/postlock/opt/etc/yaws or whatever you passed to the configure script as sysconfdir. Replace yaws.conf with this.

Configuring mnesia

Start yaws with

erl -sname s -pa /home/postlock/opt/lib/yaws/ebin/ -boot start_sasl -run mnesia start -run yaws -conf ~/opt/etc/yaws/yaws.conf

Then, stop mensia:

mnesia:stop().

Create the mnesia schema:

mnesia:create_schema([node()]).

Finally, close erlang by hitting Control-C twice.

Building postlock

Currently, postlock uses erlang's built in Emake utility.

Before you can begin building, update the Emakefiles in postlock/postlock_server/src to point to the yaws include dir (opt/lib/yaws/include). Once complete, it's just a matter of

cd ~/git/postlock/postlock_server/src; erl -make

cd ~/git/postlock/applications/postlock_test/src; erl -make

Restart erlang using the command we used when setting up mnesia.

Adding postlock_test to yapp

Go to http://localhost:8081/yapp/ and add the postlock_test application (leave the path blank).

Installing natively on windows

Please expand this section if you can! The steps are:

  1. Install erlang, yaws (version >= 1.89) and msysgit. Download and unzip unxutils. If you dont have the openssl libraries installed yet, then install them also.
  2. Update your PATH to include the erlang binaries in System properites - advanced - environment variables (the path is something like c:\program files\erl5.8.3\bin).
  3. Start git-bash as administrator (right-click on the git icon and select run as administrator) and issue the following commands:
cd "/c/Program Files/Yaws-1.89/applications/yapp/src"
"c:\Users\neu\opt\UnxUtils\usr\local\wbin\make.exe"

Correct the commands to reflect your yaws and unxutils directories respectively. The quotes are important. 4. Create a folder for postlock data (eg: c:\Users\neu\Documents\postlock-data). 3. Update yaws.conf (you can modify the linux version). 4. Start erlang, stop mnesia, create mnesia schema (as described in the linux part of this guide). 5. Build postlock 6. Restart yaws.

Trying out postlock

Visit http://localhost:8081/postlock_test/ with any websocket-capable browser.