Node.js support

Hello All,

I think the issue is related to pm2 user / folder permissions
Using below code as test:
app.js

#!/usr/bin/env nodejs
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen('/home/**user**/web/**domain.domain.domain**/nodeapp/app.sock');
console.log('Server running at ');

when I ran node app.js in user folder this has created the app.sock

and if I follow the permission found inside the NodeJS.sh I could get the script within my domain.
chmod a+w "$home/$user/web/$domain/nodeapp/app.sock"

Then I followed below article so I could ran pm2 under user and when running pm2 start app.js as well successful create the app.sock
https://medium.com/@sobus.piotr/pm2-share-the-same-daemon-process-between-multiple-users-dd7ecae6197a

Now i do not know how to sort out permissions either for nodeapp folder or for the user. So this can run with NodeJS.sh under webcontrol

1 Like