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
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
參考文章1:nginx error_log 錯誤日志配置說明
如圖,啟動nginx時報錯:
[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)我直接把缺少的文件手動創建了,。。
mkdir xxxx/xxxx/xxx… -p 之類的
touch xxx
reboot后又沒了。。。。
看這篇文章說用-t命令能測試nginx,果然,又多輸出了一個錯誤:
[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]#看這篇文章說,只有root用戶才能使用1024以下的端口,但是我已經是root用戶了呀,怎么還是提示我沒權限呢?是不是我要把端口80改成1024以上?
20211022
DS的人說,你先killall webs(不要注釋/opt/init/run.sh里的deamon),然后再運行/etc/init.d/dS50nginx restart就可以了,
總結
以上是生活随笔為你收集整理的nginx报错:nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log“ failed (2: N的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: msvc MinGW gcc g++关系
- 下一篇: arm linux下nginx服务无法正