Problem with Ngnix in OS X Mavericks [closed]

-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)

    
asked by anonymous 05.02.2014 / 17:10

2 answers

1

Run 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 subtract nginx

    
05.02.2014 / 17:17
1

The error message is saying two things:

1st - that the user running NginX does not have access permissions to error log file : /usr/local/var/log/nginx/error.log

2nd - directory of access log file does not exist : /Users/username/code/product/log

I would solve the case as follows:

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

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

2nd - changing the NginX log file settings for files that can be accessed by the respective user (in directories that exist, of course) ... run the following commands to check which files are the settings: / p>

cd /etc/nginx
sudo grep -R log *

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

Note: The commands above are for a modern Linux Ubuntu; if your system is different, apply the appropriate adaptations

    
05.02.2014 / 17:32