新装NGINX重启,出现错误 nginx: [error] open() "/usr/local/nginx/logs/nginx.pid"
重装nginx出现,重启出现错误
./nginx -s reload
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
解决办法:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
命令解释:
-c filename : set configuration file (default: conf/nginx.conf) 设置配置文件
设置成功之后在之前报错的路径下会生成 nginx.pid 文件
在设置的时候可能会出现如下错误:
nginx: [emerg] bind() to 0.0.0.0: failed (: Address already in use)
nginx: [emerg] bind() to 0.0.0.0: failed (: Address already in use)
这是因为我是重装nginx的,之前nginx没有停掉,可以使用命令杀死nginx进程
ps -ef | grep nginx | grep -v grep | awk '{print $2}' | xargs kill -
此时再-c 设置一下配置文件,之后再重启nginx
新装NGINX重启,出现错误 nginx: [error] open() "/usr/local/nginx/logs/nginx.pid"的更多相关文章
- 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) ...
- 编译php5.4的时候出现错误----configure: error: in `/usr/local/src/php540/php-5.4.0':
错误如下:checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep - ...
- 【防坑指南】nginx重启后出现[error] open() “/usr/local/var/run/nginx/nginx.pid” failed
重新启动nginx后,出现报错,原因就是下没有nginx文件夹或没有nginx.pid文件,为什么会没有呢? 原因就是每次重新启动,系统都会自动删除文件,所以解决方式就是更改pid文件存储的位置, 打 ...
- nginx启动或者重启失败,报错nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)
第一种方案: 1. 执行命令 :open /usr/local/etc/nginx 打开nginx安装目录 nginx安装目录默认位置有:(找到适合你的) /etc/nginx/nginx.conf, ...
- nginx报错 [error] open() “/usr/local/var/run/openresty.pid” failed (2: No such file or directory)
解决: 服务没有启动 使用start启动服务,因为没有start而直接使用stop或者reload报错这个问题: 如果方法一没有解决,使用方法二:-C 指定配置文件nginx.conf或者weblua ...
- nginx启动报错nginx: [error] open() "/usr/local/etc/nginx/logs/nginx.pid" failed
问题:nginx启动的时候会报丢失pid的错误 nginx: [error] open() “/usr/local/var/run/nginx.pid” failed 解决方案: sudo nginx ...
- nginx: [error] invalid PID number “” in “/usr/local/var/run/nginx/nginx.pid”
在Mac上用brew安装Nginx,然后修改Nginx配置文件,再重启时报出如下错误: nginx: [error] invalid PID number "" in " ...
- Nginx 报错: nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory) 的解决方法
今天测试域名访问不了,登陆 Linux(Ubuntu)重启Nginx: nginx -s reload 结果报错: nginx: [error] open() : No such file or di ...
- nginx [error] open() "/usr/local/nginx/logs/nginx.pid" failed的解决
今天关闭nginx后重启不了: nginx -s reload 结果报错: nginx: [error] open() "/usr/local/nginx/logs/nginx.pid&qu ...
随机推荐
- postgresql备份数据库
备份数据库:pg_dump -U username -h localhost -f /me.sql 数据库名; 恢复数据库:psql -U username -h localhost -f /me.s ...
- Python 2.x和3.x不同点
1.print和print() 2.yield 出现下面的错误Traceback (most recent call last): File “<pyshell#32>”, line 1, ...
- CQRS之旅——旅程2(分解领域)
旅程2:分解领域 设计停靠站点 "没有石头就没有拱门" --马可波罗 在本章中,我们将对Contoso会议管理系统进行一个高层次的概述.这将帮助您理解应用程序的结构.集成点以及应用 ...
- 【Linux】让Ubuntu 支持 GBK等字符集,解决中文乱码
对GBK,GB2312,GB18030字符集的支持是UBUNTU中文乱码的罪魁祸首,其实我们可以在保持UTF-8为默认编码的条件下添加对这几个编码的支持,以解决中文乱码问题. 我想这个问题肯定有其他人 ...
- UITableViewCellStyle 四种样式
四种样式如下:
- Json Web Token 简介
1.Json Web Token是干什么 简称JWT,在HTTP通信过程中,进行身份认证. 我们知道HTTP通信是无状态的,因此客户端的请求到了服务端处理完之后是无法返回给原 ...
- 淘宝H5移动端解决方案
详细:http://www.w3cplus.com/mobile/lib-flexible-for-html5-layout.html ; (function(win, lib) { var doc ...
- javascript HTML静态页面传值的四种方法
一:JavaScript静态页面值传递之URL篇能过URL进行传值.把要传递的信息接在URL上.Post.htm 代码如下: <input type="text" name= ...
- C++ 关于运算符重载
转载来源:http://c.biancheng.net/cpp/biancheng/view/216.html 重载运算符的函数一般格式如下: 函数类型 operator 运算符名称 (形参表列 ...
- Linux uart程序
我用的是jetson tx1 开发板 都是linux系统出了串口文件可能不同其他的没有什么不同都能用. 我安装的是qt5 新建一个none qt c工程,用c 语言开发 期间调试了两天结果还是发送和 ...