Welcome to the official repository of Tsunami Warning System.
TWS mainly requires
Apache ActiveMQ => 5.6.0
ActiveMQ is an open source Java JMS message queue. It supports the Stomp protocol,
which ActiveMessaging uses to send and receive messages.
Download the installation files:
wget http://archive.apache.org/dist/activemq/apache-activemq/5.6.0/apache-activemq-5.6.0-bin.tar.gz
Extract the files:
tar xvf http://archive.apache.org/dist/activemq/apache-activemq/5.6.0/apache-activemq-5.6.0-bin.tar.gz
Edit conf/activemq.xml
and add the following connector, the port number 61613
is important:
<transportConnectors>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
</transportConnectors>
./bin/activemq console
node.js => 0.10 Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
sudo apt-get install nodejs npm
Socket.io
, stomp.js
and configure
For installing these dependencies we need to install Node.js package manager first.
sudo apt-get install npm
Socket.IO
aims to make realtime apps possible in every browser and mobile device,
blurring the differences between the different transport mechanisms. It's care-free
realtime 100% in JavaScript.
npm install socket.io
STOMP provides an interoperable wire format so that STOMP clients can communicate with any STOMP message broker to provide easy and widespread messaging interoperability among many languages, platforms and brokers.
npm install stomp
A simple multiple-configuration management module
By default the nodejs
binary is created in /usr/bin
upon installing node.js
.
The Configure
will be installed using the command node install.js
, what we
need to is to create a symbolic link to /usr/bin/node
from nodejs
binary.
sudo ln -s /usr/bin/nodejs /usr/bin/node
npm install configure
node server.js --config config.json
node sensor-buoy.js <ALERT-TYPE> <BUOY-NAMES> --config config.json
ALERT-TYPES:
reg-alert
: Regular Alert
low-alert
: Low Alert
med-alert
: Medium Alert
high-alert
: High Alert
BUOY-NAMES:
buoy1
buoy2
buoy3
TWS comes along with a web service
You could deploy it in either apache
or nginix
.
For the simplicity, I prefer, apache
sudo apt-get install apache2
Copy web-service
to /var/www
directory
cp -r web-server /var/www
Change the DocumentRoot
to /var/www/web-service
in
/etc/apache2/sites-available/000-default.conf
file.
Restart the apache to apply the changes
sudo service apache2 restart
You could now open your browser and see what's running on your localhost
webserver
http://localhost