Nginx 启动报错 “/var/run/nginx/nginx.pid" failed”
问题:
重启虚拟机后,再次重启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;即没有指定pid的情况下默认路径在/var/run/nginx下.

(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 启动报错 “/var/run/nginx/nginx.pid" failed”的更多相关文章
- 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 ...
- nginx 启动报错 “/var/run/nginx/nginx.pid" failed” 解决方法
问题: 重启虚拟机后,再次重启nginx会报错: open() "/var/run/nginx/nginx.pid" failed (2: No such file or dire ...
- nginx启动报错:Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' fo
一.背景 这个错误在重启nginx或者启动nginx的时候,经常会出现.我之前也一直认为出现这个错误是因为有程序占用了nginx的进程.但是知其然不知其所以然.每次报错都有点懵逼,所以这边一步步排查错 ...
- nginx 启动报错找不到nginx.pid文件
这个问题的出现应该是系统找不到nginx的配置文件nginx.conf,所以,我们要告诉系统配置文件的位置:' --- 使用nginx -c /usr/local/nginx/conf/nginx.c ...
- redis启动报错 var/run/redis_6379.pid exists, process is already running or crashed
redis启动显示 /var/run/redis_6379.pid exists, process is already running or crashed 出现这个执行 rm -rf /var/r ...
- nginx启动报错:/usr/local/nginx/sbin/nginx: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
查看依赖库:
- 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 ...
- Win7下nginx默认80端口被System占用,造成nginx启动报错的解决方案
Win7下nginx默认80端口被System占用,造成nginx启动报错的解决方案 在win7 32位旗舰版下,启动1.0.8版本nginx,显示如下错误: [plain] 2012/04/0 ...
- tomcat启动报错:Injection of autowired dependencies failed
tomcat启动报错:Injectjion of autowired dependencies failed 环境: 操作系统:centos6.5 tomcat: 7.0.52 jdk:openjdk ...
随机推荐
- Spark的Driver节点和Executor节点
转载自:http://blog.sina.com.cn/s/blog_15fc03d810102wto0.html 1.驱动器节点(Driver) Spark的驱动器是执行开发程序中的 main方法的 ...
- socketserver 并发连接
socketserver.TCPServer Example server side 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ...
- spl_autoload_register(转载 http://blog.csdn.net/panpan639944806/article/details/23192267)
在了解这个函数之前先来看另一个函数:__autoload. 一.__autoload 这是一个自动加载函数,在PHP5中,当我们实例化一个未定义的类时,就会触发此函数.看下面例子: printit.c ...
- SQLSERVER2016 无域控AlwaysOn 实施步骤
SQLSERVER2016 无域控AlwaysOn 实施步骤 步骤: 一.安装3个windows server 2016系统 1)在3台机器建立具有administrators权限的相同账号密码,本例 ...
- idea构建一个简单的maven_web项目
软件说明 好啦,开始创建mave的web项目啦!
- 手写ArrayList、LinkedList
ArrayList package com.hjp.labs; import org.omg.CORBA.PRIVATE_MEMBER; /* 一.ArrayList的底层是Object类的数组,默认 ...
- 『NiFi 学习之路』使用 —— 主要组件的使用
一.概述 大部分 NiFi 使用者都是通过 NiFi 的 Processor 来实现自己的业务的.因此,我也主要就 NiFi 官方提供的 Porcessor 进行介绍. 二.Processor 如果你 ...
- 第三方库(JSONModel)出现file not found
http://stackoverflow.com/questions/5198905/h-file-not-found 具体方法: 在导航栏中 点击 Product --> Clean 成功之后 ...
- eclipse web项目的发布路径
java Build path是编译路径设置,主要用来设置源代码的编译路径默认是default output folder Web Deployment Assembly是eclipse中的发布路径设 ...
- 20145302张薇 Java第一周学习总结
20145302张薇 <Java程序设计>第一周学习总结 教材学习内容总结 第一章 1995年,java被公认诞生.java第一开始为了消费性数字产品(如手机)而设计,所以java本身有很 ...