新装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 ...
随机推荐
- 练习六:斐波那契数列(fibonacci)
题目:斐波那契数列. 程序分析:斐波那契数列(Fibonacci sequence),又称黄金分割数列,指的是这样一个数列:0.1.1.2.3.5.8.13.21.34.……. 在数学上,斐波那契数列 ...
- php配置redis
redis扩展程序下载链接(版本3.0.504) 链接: https://pan.baidu.com/s/1QfrjtnifOl8SPf7XCEly2g 密码: u6x6 wampserver下载地址 ...
- 页面上AJAX调用数据
<div class="section page9" data-page='9'> <div class="global-section-wrp med ...
- UVALive 7511 L - Multiplication Table 数学模拟题,暴力
给定一副表,问其是否合法. 思路:当全部是?的时候,是合法的. 如果不是,那么,就找到一个数字,把它拆成若干个a*b的形式,去判断其它点是否合法即可. 拆分数字的时候,只需要枚举到sqrt(n),因为 ...
- GraphQL实战经验和性能问题的解决方案
在现在的公司使用GraphQL有一段时间了. 现公司从创立之后的很长一段时间内是纯PHP的技术栈,前端.后端都在PHP代码中糅合在一起.新功能越加越多,页面越来越复杂之后,那些混在在PHP代码中的HT ...
- jQuery动态添加元素,并提交json格式数据到后台
参考:https://www.cnblogs.com/shj-com/p/7878727.html 下载 下载该插件的地址是:http://www.bootcdn.cn/jquery.serializ ...
- 解决ARCGIS10.2与VS2013不兼容
在注册表中HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0增加类型为REG_SZ的InstallDir节点.Ins ...
- agc015F - Kenus the Ancient Greek(结论题)
题意 题目链接 $Q$组询问,每次给出$[x, y]$,定义$f(x, y)$为计算$(x, y)$的最大公约数需要的步数,设$i \leqslant x, j \leqslant y$,求$max( ...
- https 双向验证
服务器配置 服务器秘钥 服务器公钥证书 ,客户端公钥证书 客户端配置 客户端秘钥+密码 服务器公钥证书 目前android验证ok,pc浏览器添加客户端秘钥证书 ,访问还是失败,待继续查找资 ...
- leetcode 355 Design Twitte
题目连接 https://leetcode.com/problems/design-twitter Design Twitte Description Design a simplified vers ...