错误

第一次探索nginx,执行以下命令时:

nginx -s reload

报出错误:

nginx: [error] invalid PID number "" in ...

*此时忽略掉了warn警告信息

排查

Step 1

baidu搜索了一众文章,大都是说执行:

nginx -c /etc/nginx/nginx.conf

*地址改成自己的(如,win10下,F:\install\nginx-1.16.1\logs\nginx.conf)

参考例:

而执行之后并没有解决


Step 2

执行 nginx -t 查看测试结果

发现 80 端口被占用的问题:

我们都知道,windows 10 上的 IIS 默认站点的默认端口即 80,

而我将它改为了 808,所以,

此时 80 端口占用问题,应该跟 IIS 没有关系。

Step 3

找到该问题一致的文章:

Nginx 错误10013: An attempt was made to access a socket in a way forbidden

方案是:

  • 找到占用该端口(80)的 PID(进程ID),
  • 在任务管理器中找到这个 PID 的进程,kill终止它

但是,不同的是,

netstat -aon | findstr ":80"

查找到的 80 端口占用 PID 为 4,

任务管理器中PID=4的进程为System,

也就是说,不能终止进程,方案行不通。

*并不是一个可以终止的进程,右键终止是不可用的状态

解决

最终解决是因为找到了【泡泡虾】的文章:

80端口被system占用解决过程

虽然该作者并不是在使用 nginx 的时候遇到的问题,

但本质和解决方法是一样的。

即:

开始菜单 -> services.msc -> 找到SQL Server Reporting Services`服务 -> 停止掉

  • Service名:ReportServer
  • 显示名:SQL Server Reporting Services (MSSQLSERVER)

此时,再检查一下端口情况 netstat -aon | findstr ":80"

已经没有 80 端口了。

执行nginx -t测试结果也通过了(successful)


但是,nginx -s reload还是一开始的错误,并没有解决。

再次启动nginx:

start nginx.exe

OK~

[nginx报错问题]reload时报错:nginx: [error] invalid PID number "" in ...的更多相关文章

  1. nginx重启报错:nginx: [error] invalid PID number "" in "/run/nginx.pid"

    问题描述:执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number “” in “/run/ngin ...

  2. Centos7.5中Nginx报错:nginx: [error] invalid PID number "" in "/run/nginx.pid" 解决方法

    服务器重启之后,执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number "" ...

  3. nginx: [error] invalid PID number "" in "/run/nginx.pid"

    在重启云主机(系统)之后,执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number “” in “/ ...

  4. nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"

    iwangzheng.com tty:[0] jobs:[0] cwd:[/opt/nginx/conf] 12:45 [root@a02.cmsapi]$ /usr/local/nginx/sbin ...

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

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

  6. 解决 nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"

    使用/usr/local/nginx/sbin/nginx -s reload 重新读取配置文件出错 [root@localhost nginx]/usr/local/nginx/sbin/nginx ...

  7. nginx: [error] invalid PID number "" in "/usr/local/webserver/nginx/logs/nginx.pid" (原)

    进入nginx文件下,例如 :/usr/local/nginx/sbin [root@iZ25f7emo7cZ /]# cd /usr/local/nginx/sbin 运行命令: [root@iZ2 ...

  8. nginxUbuntu安装Nginx和正确卸载Nginx Nginx相关 与Nginx报错:nginx: [error] invalid PID number "" in "/run/nginx.pid" 解决方法

    https://www.cnblogs.com/zhaoyingjie/p/6840616.html https://blog.csdn.net/adley_app/article/details/7 ...

  9. nginx: [error] invalid PID number "" in ...

    1.查看进程 ps -ef|grep nginx 2.进入nginx安装目录sbin下,执行命令: ./nginx -t 如下显示: syntax is ok test is successful 3 ...

随机推荐

  1. #Week3 Linear Regression with Multiple Variables

    一.Multiple Features 这节课主要引入了一些记号,假设现在有n个特征,那么: 为了便于用矩阵处理,令\(x_0=1\): 参数\(\theta\)是一个(n+1)*1维的向量,任一个训 ...

  2. CF思维联系–CodeForces - 222 C Reducing Fractions(数学+有技巧的枚举)

    ACM思维题训练集合 To confuse the opponents, the Galactic Empire represents fractions in an unusual format. ...

  3. ACM-ICPC 2019 山东省省赛D Game on a Graph

    Game on a Graph Time Limit: 1 Second Memory Limit: 65536 KB There are people playing a game on a con ...

  4. css属性、样式、边框、选择器

    CSS 层叠样式表 (Cascading Style Sheets,缩写为 CSS),是一种 样式表 语言, 用来描述 HTML或 XML(包括如 SVG.MathML.XHTML 之类的 XML 分 ...

  5. GIL-Guilds(黑白灰染色)

    传送门门门门门咩咩咩咩咩咩咩咩咩咩咩咩 \(这题真是扯谈!!!\) \(灰色很高级是吧,但是题目没要你把颜色全部用上去啊!!!\) \(黑色或者白色只有一个条件,但灰色需要和所有三种颜色都相邻.这么难 ...

  6. MATLAB矩阵的表示

    矩阵是matlab中最基本的数据对象. l  矩阵的建立 l  冒号表达式 l  结构矩阵和单元矩阵 1.矩阵的建立 (1)利用直接输入法建立矩阵:将矩阵的元素用中括号括起来,按矩阵行的顺序输入各元素 ...

  7. OpenWrt R2020.3.11 去广告 抗污染 加速 PSW 无缝集成 UnPnP NAS

    近期更新:OpenWrt R2020.3.11版本2020.03.16编译. 按大家要求,新发布固件携带了编译时用到的全部软件包 加入了国内域名加速解析脚本 解决了原去广告,DNS优化方案与PSW冲突 ...

  8. 【Hadoop离线基础总结】linux的shell编程

    linux的shell编程 基本了解 概述 Shell是一个用C语言编写的程序,通过shell用户可以访问操作系统内核服务,它类似于DOS下的command和后来的cmd.exe.Shell既是一种命 ...

  9. 实现简单网页rtmp直播:nginx+ckplayer+linux

    一.安装nginx 安装带有rtmp模块的nginx服务器(其它支持rtmp协议的流媒体服务器像easydarwin.srs等+Apache等web服务器也可以),此处使用nginx服务器,简单方便. ...

  10. CF#214 C. Dima and Salad 01背包变形

    C. Dima and Salad 题意 有n种水果,第i个水果有一个美味度ai和能量值bi,现在要选择部分水果做沙拉,假如此时选择了m个水果,要保证\(\frac{\sum_{i=1}^ma_i}{ ...