nginx报错:nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log“ failed (2: N
生活随笔
收集整理的這篇文章主要介紹了
nginx报错:nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log“ failed (2: N
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
參考文章1:nginx error_log 錯(cuò)誤日志配置說(shuō)明
如圖,啟動(dòng)nginx時(shí)報(bào)錯(cuò):
[root@RV1126_RV1109:/usr/sbin]# nginx -c /etc/nginx/nginx.conf nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory) 2021/10/19 15:42:22 [emerg] 2434#0: mkdir() "/var/tmp/nginx/client-body" failed (2: No such file or directory)我直接把缺少的文件手動(dòng)創(chuàng)建了,。。
mkdir xxxx/xxxx/xxx… -p 之類的
touch xxx
reboot后又沒(méi)了。。。。
看這篇文章說(shuō)用-t命令能測(cè)試nginx,果然,又多輸出了一個(gè)錯(cuò)誤:
[root@RV1126_RV1109:/usr/sbin]# nginx -t nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory) nginx: the configuration file /etc/nginx/nginx.conf syntax is ok 2021/10/19 15:49:35 [emerg] 2781#0: mkdir() "/var/tmp/nginx/client-body" failed (2: No such file or directory) nginx: configuration file /etc/nginx/nginx.conf test failed [root@RV1126_RV1109:/usr/sbin]#看這篇文章說(shuō),只有root用戶才能使用1024以下的端口,但是我已經(jīng)是root用戶了呀,怎么還是提示我沒(méi)權(quán)限呢?是不是我要把端口80改成1024以上?
20211022
DS的人說(shuō),你先killall webs(不要注釋/opt/init/run.sh里的deamon),然后再運(yùn)行/etc/init.d/dS50nginx restart就可以了,
總結(jié)
以上是生活随笔為你收集整理的nginx报错:nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log“ failed (2: N的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: msvc MinGW gcc g++关系
- 下一篇: ps -aux 和ps -elf 区别(