Skip to content

Instantly share code, notes, and snippets.

@petrkohut
Last active June 30, 2017 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petrkohut/e029f249eab72cc10b4f to your computer and use it in GitHub Desktop.
Save petrkohut/e029f249eab72cc10b4f to your computer and use it in GitHub Desktop.
How to setup Supervisor

How to setup Supervisor

Installation

sudo apt-get install supervisor

Enable Supervisor web interface GUI

Add into file /etc/supervisor/supervisor.conf these lines:

[inet_http_server]
port = *:9001
username = admin
password = 123

Add your first job

Create new job file:

sudo touch /etc/supervisor/conf.d/worker.conf

Edit file like this:

[program:worker]
environment = NODE_ENV="production"
command=/usr/bin/node /home/user/app/index.js
autostart=true
autorestart=true
stderr_logfile=/var/log/worker.err.log
stdout_logfile=/var/log/worker.out.log

Restart Supervisor

sudo service supervisor restart

##Access Supervisor GUI http://localhost:9001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment