When I deployed my mern app on our server it throwed me a EAccess error saying unable to access my cert and key files of ssl however then I created a group for me and my root with adequate permissions so that my node server can access those files and it did worked when im running it saying either node server.js or npm start however when I do the same with pm2 start server.js its unable to access those files,Can someone help what should I do so that pm2 can access my ssl files.
Asked
Active
Viewed 153 times
0
-
I have followed the solution 4 as described in this stack overflow post: https://stackoverflow.com/questions/48078083/lets-encrypt-ssl-couldnt-start-by-error-eacces-permission-denied-open-et However with pm2 its still giving same error , not sure why pm2 is not considering as me (as user) – priyatham ik Sep 07 '22 at 19:58
1 Answers
0
if(cluster.isMaster) {
console.log('Master has been started');
cluster.fork();
cluster.fork();} else {
console.log(`Worker process started ${process.pid}`)}
Use this code. Most of the time pm2 problem.

Hamza Ali
- 32
- 6
-
Thanks for the answer however I didnt understood how this can help the pm2 in accessing those .pem files. It would be great if u can explain and how can I use this code – priyatham ik Sep 07 '22 at 20:53