Project

General

Profile

Support #648

Install JSbin On Debian

Added by Daniel Curtis over 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Server
Target version:
Start date:
08/29/2015
Due date:
% Done:

100%

Estimated time:
2.00 h
Spent time:

Description

This is a guide on installing JSbin on Debian 8.

Prepare the System

  • Make sure the system is up to date:
    apt-get update && apt-get upgrade
    
  • Install a few dependencies:
    apt-get install curl git build-essential libzmq-dev
    
  • Install nodejs and npm:
    curl -sL https://deb.nodesource.com/setup_0.10 | bash -
    apt-get install -y nodejs
    

Install JSbin with npm

  • Install JSbin using npm:
    npm install -g jsbin
    
  • Create a new config file and edit it as necessary:
    cd /usr/lib/node_modules/jsbin
    cp config.default.json config.local.json
    
  • Install a few node modules:
    npm install grunt-contrib-uglify grunt-contrib-jshint grunt-contrib-concat
    
  • Then build the production files:
    grunt build
    

Running JSbin with PM2

  • Install pm2 globally:
    npm install -g pm2
    
  • Add the startup script for pm2:
    pm2 startup ubuntu
    
  • Add a jsbin user to separate privileges:
    useradd -m -g users -s /bin/bash jsbin
    
  • Change the ownership of the global jsbin folder to the jsbin user:
    chown -R jsbin /usr/lib/node_modules/jsbin
    
  • Switch to the jsbin user:
    su - jsbin
    
    • Start jsbin using pm2:
      pm2 start /usr/lib/node_modules/jsbin/bin/jsbin
      
    • Exit from the jsbin user:
      exit
      
  • Then save the pm2 applications to allow them to start up after rebooting:
    pm2 save
    

Resources

Also available in: Atom PDF