简体   繁体   中英

Nginx not running. no such file or directory message -Mac

I ran brew install nginx and when run 'nginx' I get this msg

nginx: [emerg] open() "/usr/local/Cellar/nginx/1.8.0/logs/proxy.access.log" failed (2: No such file or directory)

looking at /usr/local I see an nginx folder exists in '/etc/nginx' and also '/Cellar/nginx'.

What am I suppose to do?

Resolved in two steps,

  1. Create directory

    sudo mkdir /usr/local/Cellar/nginx/1.xx.xx/logs
  2. Now create access.log file

    sudo touch /usr/local/Cellar/nginx/1.xx.xx/logs/access.log

As both operations involved with system files, I had to use sudo .

It looks like the file cannot be opened because it doesn't exist; try creating it with:

touch /usr/local/Cellar/nginx/1.8.0/logs/proxy.access.log

More importantly make sure you are using sudo when you run nginx

sudo nginx

I just had to create the logs directory inside the hinted folde.

mkdir /usr/local/Cellar/nginx/1.12.1/logs

and all the logs got created.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM