Posts

Showing posts from January, 2016

PM2 - Setup

Recent changes to the project now have it completely running under Node/Express/PM2. Details of the change(s) should be posted on the project's WIKI, but I thought it important enough to share what I've learned. This link was very helpful to get started. When adding the application to PM2, the following line is used to register/start the application: (THIS ONLY NEEDS TO BE RUN ONCE. There is an entry in /etc/init.d that will run the PM2 Daemon on server startup) pm2 start server/app.js –u app-www --watch --name app -- --app http://################### Let's break it down (now): "pm2" : The name of the cool Node Management platform that "on-the-fly" devotes resources to the given apps. "start" : Creates a new application "server/app.js" : The location of the main application .js "-u app-www" : The user to run under. We don't want PM2 to run as ROOT for security purposes, especially on port 80 or 443. "-