Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission issues #2

Open
peerbolte opened this issue Jun 18, 2015 · 3 comments
Open

Permission issues #2

peerbolte opened this issue Jun 18, 2015 · 3 comments

Comments

@peerbolte
Copy link

When running nginx-vhosts I run into permission issues:

{ [Error: Command failed: /bin/sh -c nginx -s reload
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2015/06/18 20:49:20 [notice] 20500#0: signal process started
2015/06/18 20:49:20 [alert] 20500#0: kill(11831, 1) failed (1: Operation not permitted)
]
  killed: false,
  code: 1,
  signal: null,
  cmd: '/bin/sh -c nginx -s reload' } '' 'nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)\n2015/06/18 20:49:20 [notice] 20500#0: signal process started\n2015/06/18 20:49:20 [alert] 20500#0: kill(11831, 1) failed (1: Operation not permitted)\n'

I had the same problem writing to the conf.d folder

first problem: write access to /etc/nginx/conf.d/
{ [Error: EACCES, open '/etc/nginx/conf.d/test.conf']
  errno: -13,
  code: 'EACCES',
  path: '/etc/nginx/conf.d/test.conf' } undefined undefined

but I temporarily solved this by chmodding it to 777. This could also be my lack of knowledge on how to provide Nodejs with sudo capabilities, but how can I run nginx-vhost without running into these issues?

@max-mapper
Copy link
Owner

What if you run the whole program with sudo? e.g. sudo node script.js

@peerbolte
Copy link
Author

Yes, I tried this but it returns

sudo: node: command not found

I might have to look into this then.. I'm running node via nvm. I fixed it by running the following line

n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local

I can now run the app using sudo. Is nginx-vhost meant to be ran using sudo?

@mafintosh
Copy link
Collaborator

Try running it with sudo -E and see if that works
On Thu 18 Jun 2015 at 15:18 joenesy [email protected] wrote:

Yes, I tried this but it returns

sudo: node: command not found

I might have to look into this then.. I'm running node via nvm


Reply to this email directly or view it on GitHub
#2 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants