Ajax Messaging Library

Peer to peer-like web browser networking using JavaScript and php

Installation instructions

These are instructions for installing the server-side component of this library. If you're only interested in how to develop web applications using the Ajax Messaging, the quick introduction might be more interesting for you.

Download

First download the zip file.

Files included

The zip contains four files: message.js, which is for the client side, and three files that go on the server: message.php, message.inc, and message.conf, and optionally a .htaccess file. The .htaccess file disables access to .inc, .conf, and .db files, and specifies rewrite rules for use with the shortUrls option.

message.php is the front end for handling posts and formating the response, message.inc contains all the database functions and logic, and message.conf defines some configuration variables; you should take a look at it. These three files should be uploaded to a directory on your server.

The database file

The message back-end uses Sqlite to store data. So you need to have a database file somewhere for this purpose. By default this file, including path, is "db/message.db". This is specified in message.conf, so if you want to change it, edit the first setting in that file.

So by default the database file is in a subdirectory called "db". This directory, or the directory you specify if you change the default setting, needs to be writable by apache/php. You can do this by specifying that everyone should have read/write/execute access to the directory in your favorite scp client, for instance.