0

I've got a nodejs server running on an ubuntu box using forever to daemonize the process. I've taken care of most things like running on port 80 and 443 so I don't have to invoke it with sudo and it's all good.

Now though I've added connect-gzip so I can compress all the static files I'm sending. On my windows box(dev) I have no problem running the server but when I try to run it on the ubuntu box I cannot access the server.

Here's the log I get from forever

Environment: prod
Using port 80 as redirect and port 443 as main.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: EACCES, open '/home/matt/myproject/src/main/webapp/build/dist/index.html.1414163787000.gz.28103.tmp'
error: Forever detected script exited with code: 8
error: Script restart attempt #1
Environment: prod
Using port 80 as redirect and port 443 as main.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: EACCES, open '/home/matt/myproject/src/main/webapp/build/dist/index.html.1414163787000.gz.28109.tmp'
error: Forever detected script exited with code: 8

If I run forever using sudo it's fine. I think this is happening because either connect-gzip, node, or forever doesn't have write permissions to that folder. Is this correct?

How can I allow write access to my folder for just node/connect-gzip/forever so I don't have to use sudo?

Community
  • 1
  • 1
Matt Foxx Duncan
  • 2,054
  • 3
  • 22
  • 37
  • is the dist folder owned by the same user as the node app is running under? – Ryan Quinn Oct 24 '14 at 16:45
  • No it's not. This problem goes deeper still. I have to run `grunt` with `sudo` because when I run it without i get another error `Warning: Unable to delete ".tmp" file (EACCES, permission denied '.tmp/concat')`. Grunt creates the build folder. `dist` folder is owned by `root` – Matt Foxx Duncan Oct 24 '14 at 17:03

0 Answers0