Ngnix problem on OS X Mavericks

Asked

Viewed 923 times

-1

Nginx:

[Alert] could not open error log file: open() "/usr/local/var/log/Nginx/error.log" failed (13: Permission denied) 2014/02/05 14:02:43 [emerg] 20175#0: open() "/Users/username/code/product/log/nginx_access.log" failed (2: No such file or directory)

  • 3

    Can describe the problem?

  • Welcome to Stackoverflow, to post a Question, you have to have a question. In your case you just posted an Error, and said it was on nginx however we do not know what you are trying to do, we do not have access to your code, much less we know how to proceed to help you, so supplement your question with a Real Question.

2 answers

1

Rotate the commands

sudo mkdir -p /Users/username/code/product/log/

sudo touch /Users/username/code/product/log/nginx_access.log

sudo chmod 777 /Users/username/code/product/log/nginx_access.log

and left the Nginx

  • sudo touch /Users/nego/code/product/log/nginx_access.log 1 touch: /Users/nego/code/product/log/nginx_access.log: No such file or directory

  • 1

    updated with an additional command

  • sudo chmod 777 nginx_access.log ls nginx_access.log Nginx Nginx: [emerg] open() "/Users/username/code/product/log/nginx_error.log" failed (13: Denied permission)

1

The error message is saying two things:

1st - that the user running Nginx has no access permissions at the error log file: /usr/local/var/log/nginx/error.log

2nd - that the directory of access log file there is no: /Users/username/code/product/log


I would solve the case as follows:

1º - checking which user is running Nginx; just check the configuration file, through the command:

sudo cat /etc/nginx/nginx.conf | grep user

2º - changing the Nginx log file settings to files that can be accessed by the respective user (in directories that exist, of course)... run the following commands to verify which files are the settings:

cd /etc/nginx
sudo grep -R log *

3º - edit the files (sudo pico nginx.conf or similar) and restart (sudo service nginx restart)


Note: the above commands serve for a modern Ubuntu Linux; if your system is another, apply the appropriate adaptations

Browser other questions tagged

You are not signed in. Login or sign up in order to post.