Nginx启动报错: could not open error log file: open() &q

Posted Isuty

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nginx启动报错: could not open error log file: open() &q相关的知识,希望对你有一定的参考价值。

启动nginx报如下错误:技术分享

nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (13:Permission denied)
2014/08/04 20:35:45 [emerg] 17114#0: open() "/usr/local/nginx/logs/access.log" failed (13: Permission denied)
原因:当前用户对该位置没有写入权限
解决办法:
1.使用命令:sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 以root权限启动
2.使用命令:sudo chmod -R a+rw /usr/local/nginx 给所有用户赋权限(个人学习,不考虑安全问题)
                    /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf  启动Nginx
 
注:以非root权限启动时,会出现 nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied) 错误
原因:Linux只有root用户可以使用1024一下的端口
解决办法:1.已root权限启动
  2.将 /usr/local/nginx/conf/nginx.conf 文件中的80端口改为1024以上
server {
# listen 80
   listen 8080
……
}


以上是关于Nginx启动报错: could not open error log file: open() &q的主要内容,如果未能解决你的问题,请参考以下文章

hb_gui 启动报错 RuntimeError: could not open display

nginx报错

报错Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop102:10000: Failed to open

domino无法启动:could not open id file

nfs 客户端启动报错rpc.mountd: svc_tli_create: could not open connection for tcp6

主节点连接hiveserver2报错Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop01:10000: