重装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"的更多相关文章

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

  3. 【防坑指南】nginx重启后出现[error] open() “/usr/local/var/run/nginx/nginx.pid” failed

    重新启动nginx后,出现报错,原因就是下没有nginx文件夹或没有nginx.pid文件,为什么会没有呢? 原因就是每次重新启动,系统都会自动删除文件,所以解决方式就是更改pid文件存储的位置, 打 ...

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

  5. nginx报错 [error] open() “/usr/local/var/run/openresty.pid” failed (2: No such file or directory)

    解决: 服务没有启动 使用start启动服务,因为没有start而直接使用stop或者reload报错这个问题: 如果方法一没有解决,使用方法二:-C 指定配置文件nginx.conf或者weblua ...

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

  7. nginx: [error] invalid PID number “” in “/usr/local/var/run/nginx/nginx.pid”

    在Mac上用brew安装Nginx,然后修改Nginx配置文件,再重启时报出如下错误: nginx: [error] invalid PID number "" in " ...

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

  9. nginx [error] open() "/usr/local/nginx/logs/nginx.pid" failed的解决

    今天关闭nginx后重启不了: nginx -s reload 结果报错: nginx: [error] open() "/usr/local/nginx/logs/nginx.pid&qu ...

随机推荐

  1. Windows开机自动登录及取消自动登录的设置

    开机自动登录 1.开始菜单搜索框输入 “netplwiz” 按回车 或“Win+R”组合键打开“运行”框内输入“netplwiz” 或“运行”框内输入“control userpasswords2”( ...

  2. jsonp——使用公共接口获取数据

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

  3. strcpy、strncpy、strlen、memcpy、memset、strcat、strncat、strcmp、strncmp,strchr

    1.strcpy #include<stdio.h> #include<assert.h> char *mystrcpy(char *dest, const char *src ...

  4. C/C++规范学习:

    一 关于浮点数: 1.1浮点数是否等于0判断:因为浮点数都有精度,不能拿浮点数直接和0.0f进行比较,而应该采用以下方法: if (f32Data == 0.0f) // 隐含错误的比较 #defin ...

  5. js车牌号校验

    function cpyz(str) {        var newcarnum= str.value.toUpperCase();    var regExp = /(^[\u4E00-\u9FA ...

  6. 对象拷贝 - 优雅的解决方案 Mapstruct

    MapStruct GitHub 访问地址 : https://github.com/mapstruct/mapstruct/ 使用例子 : https://github.com/mapstruct/ ...

  7. 性能测试学习第五天_loadrunner概述

    1.为什么要进行性能测试(性能测试贯穿于软件生命周期) The failure of a mission-critical application can be costly. Assure perf ...

  8. 《Head First 设计模式》之单件模式

    单件模式(Singleton) ——确保一个类只有一个实例,并提供全局访问点. 有一些对象其实我们只需要一个,比如线程池.缓存.对话框.处理偏好设置和注册表的对象.日志对象.如果制造出多个实例,就会导 ...

  9. 从零开始的全栈工程师——js篇2.16

    js操作css样式 div.style.width=“200px” 在div标签内我们添加了一个style属性 并设定了width值 这种写法会给标签带来了大量的style属性 跟实际项目是不符的 我 ...

  10. iis6.0 建立站点

    公司网站的服务器甚多 其中还包括早期的iis6.0 的网站服务器 由于之前没有接触过 特此记录建立站点过程和注意事项 1.每个站点最好都新建一个用户名 方便管理 这里操作系统是 winXP 现在运行界 ...