This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 704
How to install on UBUNTU 12.04
hari prasad sure edited this page Apr 12, 2017
·
6 revisions
https://github.com/fzaninotto/uptime/
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-6 g++-6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 40 --slave /usr/bin/g++ g++ /usr/bin/g++-6
sudo update-alternatives --config gcc(Choose gcc-6 version row number)
wget https://nodejs.org/dist/v4.2.1/node-v4.2.1-linux-x64.tar.gz
cd /usr/local
tar --strip-components 1 -xzf /usr/save/node-v4.2.1-linux-x64.tar.gz
node -v
npm -v
cd /opt
git clone https://github.com/fzaninotto/uptime.git node-uptime
cd node-uptime
sudo npm install
cd /opt/node-uptime
sudo nano config/default.yaml
mongodb:
server: localhost
database: uptime
user: username
password: passsword
connectionString: mongodb://localhost/uptime
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
sudo echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-10gen
http://docs.mongodb.org/manual/tutorial/add-user-administrator/
mongo
use admin
db.addUser( { user: "username", pwd: "password", roles: [ "userAdminAnyDatabase" ] } )
sudo apt-get -yq install python-setuptools
sudo easy_install supervisor
sudo echo_supervisord_conf > /etc/supervisord.conf
sudo nano /etc/supervisord.conf
[program:node-uptime]
command=node app.js
numprocs=1
#root dir of node-uptime
directory=/opt/node-uptime
stdout_logfile=/var/log/node-uptime.log
stderr_logfile=/var/log/node-uptime_error.log
autostart=true
autorestart=true
sudo nano /etc/init.d/supervisord
#! /bin/bash -e
SUPERVISORD=/usr/local/bin/supervisord
PIDFILE=/tmp/supervisord.pid
OPTS="-c /etc/supervisord.conf"
test -x $SUPERVISORD || exit 0
. /lib/lsb/init-functions
export PATH="${PATH:+$PATH:}/usr/local/bin:/usr/sbin:/sbin"
case "$1" in
start)
log_begin_msg "Starting Supervisor daemon manager..."
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $SUPERVISORD -- $OPTS || log_end_msg 1
log_end_msg 0
;;
stop)
log_begin_msg "Stopping Supervisor daemon manager..."
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE || log_end_msg 1
log_end_msg 0
;;
restart|reload|force-reload)
log_begin_msg "Restarting Supervisor daemon manager..."
start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE
start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec $SUPERVISORD -- $OPTS || log_end_msg 1
log_end_msg 0
;;
*)
log_success_msg "Usage: /etc/init.d/supervisor
{start|stop|reload|force-reload|restart}"
exit 1
esac
exit 0
sudo chmod +x /etc/init.d/supervisord
sudo update-rc.d supervisord defaults
sudo service supervisord restart
sudo supervisorctl start|stop|restart node-uptime