标题: nginx报错:nginx: [alert] could not open error log file: open() “/usr [打印本页] 作者: 饭宝 时间: 2024-8-18 08:17 标题: nginx报错:nginx: [alert] could not open error log file: open() “/usr 错误信息:
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)
复制代码
分析缘故原由
缘故原由分析:nginx/目录下没有logs文件夹
解决方案
创建文件夹并授权
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