您的当前位置:首页正文

nginx报错:nginx: [alert] could not open error log file: open() “/usr/local/nginx/logs/error.log“ faile

2024-10-23 来源:个人技术集锦

错误信息:

nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (2: No such file or directory)
2016/09/13 19:08:56 [emerg] 6996#0: open() "/usr/local/nginx/logs/access.log" failed (2: No such file or directory)


解决方案
创建文件夹并授权

mkdir logs
chmod 700 logs


验证
输入以下命令

/usr/local/nginx/objs/nginx -t


正常情况的信息输出:

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

 

显示全文