I was following the the instructions but at the end i get an error after i install the nodejs app but site is unreachable error 500 and on error log i get
2020/06/11 18:56:37 [crit] 950#950: *324 connect() to unix:/home/prn/web/site.com.net/nodeapp/app.sock failed (2: No such file or directory) while connecting to upstream, client: 171.50.159.91, server: site.net, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:/home/prn/web/site.net/nodeapp/app.sock:/ico", host: "site.net", referrer: "http://site.net/"
Not sure as for me nodejs not my coupe of tea, just a request, willing to provide a fresh DO vps at disposal to find a working solution, my app has no .sock file
I hate to use C-y-b-erpanel(no advertise) purely for this, i want to be able to use my beloved hestia
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"
@Gras Thanks for the trial, i had changed to another cp for this app, but will definitely like to get back on this and give another run, did you managed to sort out the above.
@Raphael any chance we can add this to the to do list, node.js is a great app that would do great on the future list.
@root to be fair my knowledge of Linux is limited. I think it might be related with permissions but could be wrong. The script NodeJS.sh does not do anything I even tried to change the command PM2 to “start” instead of “restart” nothing happened.
I did manage . Unless u run PM2 start under user domain and than adapt the command inside the NodeJS sh to change the permission this will work.
I think worth as well trying supervisor instead of pm2