问题:

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

解决方法:

  (1)进入 cd /usr/local/nginx/conf/ 目录,编辑配置文件nginx.conf ;

  (2)在配置文件中有个注释的地方: #pid        logs/nginx.pid;

    

  (3)将注释放开,并修改为:pid    /usr/local/nginx/logs/nginx.pid;

    

  (4)在 /usr/local/nginx 目录下创建 logs 目录:mkdir /usr/local/nginx/logs

  (5)启动nginx服务:/usr/local/nginx/sbin/nginx

重启虚拟机后,再次重启nginx会报错:[emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)的更多相关文章

  1. docker load导入镜像报错:open /var/lib/docker/tmp/docker-import-970689518/bin/json: no such file or directory

    今天将之前打包好的mysql5.7.19的tar包通过docker load命令导入到Docker环境中却报出了如下错误: [root@host---- task]# docker load < ...

  2. Nginx启动报错误unlink() “nginx.pid” failed (2: No such file or directory)

    在修改了配置文件之后,启动nginx的时候发现,进程已经存在了,但是端口没有监听到. 查看错误日志,有如下错误信息 2015/10/22 21:39:06 [alert] 26434#0: unlin ...

  3. nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

    问题场景 服务器重启后,重启nginx时报错nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: N ...

  4. nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)

    在重启nginx服务的时候,出现了这个错误. [root@izuf68g6a94fj32w0afx00z etc]# nginx -c /var/run/nginx/nginx.pid nginx: ...

  5. Nginx pid文件找不到 nginx: [error] open() "/run/nginx/nginx.pid" failed (2: No such file or directory)

    Nginx pid文件找不到 nginx: [error] open() "/run/nginx/nginx.pid" failed (2: No such file or dir ...

  6. nginx ../logs/nginx.pid" failed (2: No such file or directory)

    [1]nginx.pid相关 (1)可能出现两种场景: 1.1 nginx.pid文件不存在 发生现象:nginx: [error] open() "/usr/local/lib/ubcsr ...

  7. nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)

    当你执行sudo nginx -s reload时出现nginx: [error] open() "/run/nginx.pid" failed (2: No such file ...

  8. nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)

    nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory) ...

  9. 启动nginx出错:open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)

    [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory) 解决:mkdir / ...

随机推荐

  1. 乌龟svn不能拉取代码的原因

    因为一个账号只能在一个客户端登陆,用同一个账号的话,必然有一个会拉取失败,提示unable connect to url 解决方法: 清楚一下即可

  2. python对象序列化pickle

    import pickle class A: users = {} c = 1 def get_self(self): return self def n(self): return 1 def pi ...

  3. 转:JSON 获取属性值的方法

    JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式.易于人阅读和编写.同时也易于机器解析和生成.它基于JavaScript(Standard ECMA-262 ...

  4. torando-ioloop生命周期

    https://stackoverflow.com/questions/5375220/how-do-i-stop-tornado-web-server?answertab=votes#tab-top ...

  5. Java 日期与数字转换

    package com.test; import org.apache.commons.lang.StringUtils; import org.junit.Test; import java.tex ...

  6. spark 练习

    scala> import org.apache.spark.SparkContext import org.apache.spark.SparkContext scala> import ...

  7. Flex下打开新窗口链接

    <s:Button label="关闭推送" click="ExternalInterface.call('window.open','http://127.0.0 ...

  8. python大法好——字典、集合

    字典 前面我们说过列表,它适合于将值组织到一个结构中并且通过编号对其进行引用.字典则是通过名字来引用值的数据结构,并且把这种数据结构称为映射,字典中的值没有特殊的顺序,都存储在一个特定的键(key)下 ...

  9. Spring cloud info信息显示

    父工程添加配置如下 <build> <finalName>microservicecloud</finalName> <resources> <r ...

  10. google event

    一目了然,也不用多说了,随便记录下,内部实现基于观察者模式 TestEvent public class TestEvent { private final int message; public T ...