启动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的更多相关文章

  1. 报错问题:InnoDB: Error: log file ./ib_logfile0 is of different size

    InnoDB: Error: log file ./ib_logfile0 is of different size bytesInnoDB: than specified in the .cnf f ...

  2. Nginx启动报错:10013: An attempt was made to access a socket in a way forbidden

    Nginx在win7,win2008下启动报错:bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket i ...

  3. vue解决启动报错cjs loader.js Error: Cannot find module '../config'问题

    vue解决启动报错cjs loader.js Error: Cannot find module '../config'问题 今天下载了一个开源项目一直运行不了,折腾了半天才找到问题所在,config ...

  4. Win7下nginx默认80端口被System占用,造成nginx启动报错的解决方案

    Win7下nginx默认80端口被System占用,造成nginx启动报错的解决方案   在win7 32位旗舰版下,启动1.0.8版本nginx,显示如下错误:  [plain] 2012/04/0 ...

  5. nginx 启动报错“var/run/nginx/nginx.pid" no such file or directory

    nginx 启动报错“var/run/nginx/nginx.pid" no such file or directory 今天刚搭建的nginx服务器启动时,报错“var/run/ngin ...

  6. VM虚拟机启动报错Reason Failed to lock the file怎么办

    VMware启动报错Reason: Failed to lock the file的解决方法 症状:  启动VMware虚拟机的时候出现了Cannot open the disk '*.vmdk' o ...

  7. nginx默认80端口被System占用,造成nginx启动报错的解决方案

    今天启动window上的nginx总是报错 错误信息是bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socke ...

  8. nginx 启动报错 “/var/run/nginx/nginx.pid" failed” 解决方法

    问题: 重启虚拟机后,再次重启nginx会报错: open() "/var/run/nginx/nginx.pid" failed (2: No such file or dire ...

  9. Nginx 启动报错 “/var/run/nginx/nginx.pid" failed”

    问题: 重启虚拟机后,再次重启nginx会报错: open() "/var/run/nginx/nginx.pid" failed (2: No such file or dire ...

随机推荐

  1. winform上控件太多,绘制时会逐个出现,通常说双缓冲能解决但实际不能解决的问题的解决方法。

    protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; cp.ExStyle ...

  2. 轻量级Lua IDE ZeroBrane Studio 的使用技巧和汉化

    快捷键 : alt + shift +鼠标 ,可以块选中文本. F12 折叠/展开 所有 F5 调试运行 点击第二次 将跳转到第一个断点处 F10 单步执行 shift +F10 单步执行,不进入函数 ...

  3. JSP中动态include和静态include的区别(简版)

    动态的include: 用法:<jsp:include page="1.jsp" flush="true" /> 特点:行为元素,可以带参数:先编译 ...

  4. SOAOffice和iWebOffice、NTKO的比较及其优势(转)

    http://www.cnblogs.com/liping13599168/articles/1681465.html SOAOffice和iWebOffice.NTKO的比较及其优势 近年来,市场上 ...

  5. 【MySQL】drop大表

    利用硬链接和truncate降低drop table对线上环境的影响 众所周知drop table会严重的消耗服务器IO性能,如果被drop的table容量较大,甚至会影响到线上的正常. 首先,我们看 ...

  6. 使用git新建分支以及管理分支

    在进行分支相关的操作前, 我们需要保持主分支干净, 所谓的干净就是没有任何改变(所有更改都已经commit 并 push),那么你可以在任何时候从你的主分支创建一个新分支. 为了方便代码管理,我们应该 ...

  7. OAF_开发系列03_实现OAF如何在保存前判断数据是否存在变更(案例)

    2014-06-26 Created By BaoXinjian

  8. GDB 调试遇到??的问题

    今天总算解决了一个大的bug,爽! 我的程序crash,有了coredump文件,在Linux PC上用arm-linux-gdb debug it. The result is: #0  0x402 ...

  9. lucene 内存索引 和文件索引 合并

    IndexWriter.addIndexes(ramDirectory); http://blog.csdn.net/qq_28042463/article/details/51538283 在luc ...

  10. selenium之操作ChromeDriver

    链接:http://www.testwo.com/blog/6931 1.下载ChromeDriver驱动包(下载地址: http://chromedriver.storage.googleapis. ...