Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Configuring Sails

Nikz Jon edited this page Apr 28, 2015 · 4 revisions

Configuring Sails

Note : Following procedure is only recommended for production.

Here we will host this as a sub-domain.

$ cd /srv/www/<domain_name>/subdomains/

$ git clone [email protected]:MozillaKerala/MKO.git

This will create a sails folder called 'MKO'

$ cd MKO

Install dependencies listed in package.json

$ npm install

Start the server in production environment using pm2 module with --prod option

$ pm2 start app.js --prod

We need to run this module each time system reboots.

For ubuntu users,

$ pm2 startup ubuntu

For centos/fedora users,

$ pm2 startup centos

This is ask you to run a command with sudo access,

[PM2] You have to run this command as root. Execute the following command:
      sudo env PATH=$PATH:/usr/bin pm2 startup centos -u nikz

When we execute that command, the pm2 will get setup for startup at booting.