AtomJump Messaging Server

Installation Guide

Requirements

  • PHP. This software has been fully tested on PHP 5.3, 5.5, 7.0, 7.1 (with curl, php-mbstring, zip, php-xml support added)
  • MySQL 5+
  • Apache 2
  • Linux server (though a Windows server may be partially functional)

Recommended pre-installation steps

Modify the upload size in php.ini (found in e.g. /etc/php5/apache2/php.ini)

upload_max_filesize = 10M
max_execution_time = 200
service apache2 reload

Imagemagick can be used to handle image uploads (Ubuntu command):

sudo apt-get install imagemagick

To keep timing in-sync (Ubuntu command):

sudo apt-get install ntp

Optional Components

  • Multi-server MySQL clusters (single-write or multi-write)
  • Load balancers with haproxy
  • SSL messaging server
  • SSL database connection

Installation

On your Linux server, download and unzip the latest release of the loop-server from https://github.com/atomjump/loop-server/releases

https://github.com/atomjump/loop-server/releases

Or git clone

git clone https://github.com/atomjump/loop-server.git

Or using composer https://getcomposer.org/ see https://packagist.org/packages/atomjump/loop-server

composer require atomjump/loop-server

We will refer to paths as being from the root of the loop-server folder.

  1. /server folder. You can refer to some example server configuration files. Replace atomjump with your own domain, and put any relevant files into your Apache ‘sites available’ setup. You may need to restart Apache.
  2. /config/configORIGINAL.json. Copy this file to /config/config.json. Replace the options with your own accounts and paths (see the Server Options page for a description of each field). Copy /config/messagesORIGINAL.json to /config/messages.json. Replace these options with your own words or languages.
  3. Create a temporary image upload directory at /images/im
chmod 777 /images/im
  1. Copy /SET_AS_htaccess to /.htaccess and replace atomjump.org with your domain in this file.
  2. Customer defined themes must be on a secure server if the server is on ssl.
  3. To the ajFeedback object in your index.html, add a parameter
 "server": "http://yourserver.com"
  1. In a MySQL prompt, run ‘create database atomjump’. Then from the command line:
 mysql -u youruser -p atomjump < db/atomjump-loop-shell.sql

Optional Installation

Add two cron tasks to your server:

  • A typing cleanup task. On rare instances, a ‘typing…’ message is left (if the machine cut out etc.). This cleans up any of these old messages periodically (every 5 minutes).
sudo crontab -e  
*/5 * * * *	/usr/bin/php /yourserverpath/typing-cron.php  
  • A sentiment analysis task. This sentiment is reflected when you download a spreadsheet of the messages. It requires nodejs to be installed and available to be run by a cron job.

On your internet server, first install NodeJS and npm. See Ubuntu install notes at https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server, but there are several ways to do this depending on your platform e.g. MacOSX may vary slightly.

cd /yourserverpath/node  
npm install  
sudo crontab -e  
 */1 * * * * /usr/bin/nodejs /yourserverpath/node/sentiment.js -production  

This will update the production database message sentiments once every minute (or remove the -production to go to staging).


Windows installation

Running on Windows has currently not been tested, but you can use a Ubuntu 14.04 virtual machine from https://bitnami.com/stack/lamp/virtual-machine


Once this is installed…

Please see the server user guide to configure the server correctly.


License

This software is open source under the MIT license. Copyright is with the AtomJump Foundation (New Zealand), a non-profit society. You can use this software for any commercial purposes.