AtomJump Messaging Server
- PHP. This software has been fully tested on PHP 5.3, 5.5, 7.0, 7.1 (with php-curl, php-mbstring, php-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
- Multi-server MySQL clusters (single-write or multi-write)
- Load balancers with haproxy
- SSL messaging server
- SSL database connection
On your Linux server, download and unzip the latest release of the loop-server from 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.
- /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.
- /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.
- Allow image uploads, and image caching by the browser within /images/im
a2enmod expires [optional, and may already be enabled] chmod 777 /images/im
- Copy /SET_AS_htaccess to /.htaccess and replace atomjump.com with your domain in this file.
- Customer defined themes must be on a secure server if the server is on ssl.
- To the ajFeedback object in your index.html, add a parameter
- In a MySQL prompt, run ‘create database atomjump’. Then from the command line:
mysql -u youruser -p atomjump < db/atomjump-loop-shell.sql
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).
- A system monitoring warning, that checks whether the server’s CPU or disk space have gone over a threshold. See warningDiskUsage, warningCPUUsage in the “Server Options” section, for more details.
sudo crontab -e */5 * * * * /usr/bin/php /yourserverpath/typing-cron.php */5 * * * * /usr/bin/php /yourserverpath/monitor.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).
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.
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.