Nginx nginx: [error] open() "/usr/local/var/run/nginx.pid"

简介: Nginx nginx: [error] open() "/usr/local/var/run/nginx.pid"

  • 在启动或者停止 Nginx 的时候报错:


nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)


  • 错误原因:未找到 nginx.pid 文件。

  • 解决办法一


直接运行服务器 $ nginx 如果报错这个看文章: nginx: [emerg] bind() to 0.0.0.0:8083 failed (48: Address already in use),先关掉进程,重启一下服务器,一般重启的时候会创建没有的配置文件。


  • 解决办法二


执行 $ nginx -t 通过帮你检查配置文件,顺便会帮你创建 nginx.pid 文件。


  • 解决办法三


1、找到 nginx.conf 目录,例如:Mac路径 $ cd /usr/local/etc/nginx


2、运行命令 $ nginx -c /usr/local/etc/nginx/nginx.conf


3、运行命令 $ nginx -s reload 刷新一下就可以了。


相关文章
|
1月前
|
应用服务中间件 nginx
yum 安装报错 No package nginx available Error:Nothing to do
yum 安装报错 No package nginx available Error:Nothing to do
86 1
|
1月前
|
应用服务中间件 nginx Docker
Docker中报错 Error response from daemon: Conflict. The container name “/nginx01“ is already in use
在尝试运行 `docker run -d --name nginx01 -p 3344:80 nginx` 时遇到错误。问题源于已有名为 nginx01 的容器未正确终止,造成命名冲突。解决方法:首先使用 `docker ps -a` 查看所有容器,然后删除现有 nginx01 容器,执行 `docker rm <container_id>`(替换 `<container_id>` 为实际容器ID),最后再运行 `docker run` 命令即可。
|
1月前
|
应用服务中间件 nginx 容器
error: a container name must be specified for pod pod-base, choose one of: [nginx busybox]
error: a container name must be specified for pod pod-base, choose one of: [nginx busybox]
40 0
|
1月前
|
存储 应用服务中间件 nginx
【各种问题处理】nginx报错nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
【1月更文挑战第13天】【各种问题处理】nginx报错nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
|
7月前
|
JavaScript 前端开发 Ubuntu
nginx部署vue后显示500 Internal Server Error解决方案
nginx部署vue后显示500 Internal Server Error解决方案
197 0
|
7月前
|
JavaScript 前端开发 Ubuntu
nginx部署vue后显示500 Internal Server Error解决方案
nginx部署vue后显示500 Internal Server Error解决方案
244 0
|
5天前
|
前端开发 Java 应用服务中间件
若依分离板nginx配置
若依分离板nginx配置
12 1
|
10天前
|
应用服务中间件 Linux 定位技术
配置和管理Nginx服务
配置和管理Nginx服务
22 4
|
10天前
|
缓存 运维 应用服务中间件
理解和正确配置 Nginx 的 `location` 块是使用 Nginx 时至关重要的一部分
理解和正确配置 Nginx 的 `location` 块是使用 Nginx 时至关重要的一部分
20 2
|
12天前
|
缓存 Ubuntu 应用服务中间件
Ubuntu 22.04 上安装、配置和使用 Nginx 可以分为几个简单的步骤
Ubuntu 22.04 上安装、配置和使用 Nginx 可以分为几个简单的步骤