在重启nginx服务的时候,出现了这个错误。

[root@izuf68g6a94fj32w0afx00z etc]# nginx -c /var/run/nginx/nginx.pid
nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)

解决办法:

[root@izuf68g6a94fj32w0afx00z etc]# nginx -c /etc/nginx/nginx.conf

其他的一些解决办法:

1、进入到文件夹下:cd /var/run ,查看有没有nginx文件夹,如果没有,则创建,然后在启动

2、进入到 nginx.conf文件,找到如下pid的位置,对pid这一行注释掉。然后重启。

user  root;
worker_processes 1; error_log /var/log/nginx/error.log warn;
pid /var/run/nginx/nginx.pid; events {
worker_connections 1024;
}

nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)的更多相关文章

  1. 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) ...

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

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

  3. 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 ...

  4. 启动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 / ...

  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: [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 ...

  7. 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 ...

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

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

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

    测试服务器 问题描述 [root@g-s-- nginx]# /usr/sbin/nginx -c /etc/nginx/nginx.conf open() : No such file or dir ...

随机推荐

  1. html超文本标记语言

     <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  2. Tmk吃汤饭

    问题 : Tmk吃汤饭 时间限制: 1 Sec  内存限制: 128 MB 题目描述 Tmk喜欢吃汤饭! Tmk喜欢吃汤饭!! Tmk喜欢吃汤饭!!! 汤饭窗口分点餐和取餐两个窗口,一位蜀黍负责点餐窗 ...

  3. CHENGDU3-Restful API 接口规范、django-rest-framework框架

    Restful API 接口规范.django-rest-framework框架 问题:什么是API? 答:API是接口,提供url. 接口有两个用途: 为别人提供服务,前后端分离. 为什么使用前后端 ...

  4. js 压缩上传的图片方法(默认上传的是file文件)

    //压缩图片方法 function compressImg(file,callback){ var src; var fileSize = parseFloat(parseInt(file['size ...

  5. C/C++字节序(大端/小端)判断

    C/C++大端小端判断 说的是变量的高字节.低字节在内存地址中的排放顺序. 变量的高字节放到内存的低地址中(变量的低字节放到内存的高地址中)==>大端 变量的高字节放到内存的高地址中(变量的低字 ...

  6. C#enum使用Attribute求字段名

    用到了一些反射:(自己看吧) public enum UserState { /// <summary> /// 正常 /// </summary> [Remark(" ...

  7. Hadoop ConnectTimeoutException

    晚上继续学习tfidf示例.在跑TwoJob的时候报如下错误,开始以为是node02的防火墙没关好,但看了一下防火墙确实是关了的. 2019-03-30 23:48:19,705 INFO retry ...

  8. 用vi编辑文件

    原文:https://www.ibm.com/developerworks/library/l-lpic1-103-8/index.html Overview In this article, lea ...

  9. Scala学习教程笔记二之函数式编程、Object对象、伴生对象、继承、Trait、

    1:Scala之函数式编程学习笔记: :Scala函数式编程学习: 1.1:Scala定义一个简单的类,包含field以及方法,创建类的对象,并且调用其方法: class User { private ...

  10. vue.js学习:1.0到2.0的变化(区别)

    一.生命周期 1.1.0的生命周期: 周期 解释 init 组件刚刚被创建,但Data.method等属性还没被计算出来 created 组件创建已经完成,但DOM还没被生成出来 beforeComp ...