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 刷新一下就可以了。


相关文章
|
3月前
|
应用服务中间件 PHP nginx
PHP ERROR: Unable to create the PID file (/usr/var/run/php-fpm.pid).: No such file or directory (2)
PHP ERROR: Unable to create the PID file (/usr/var/run/php-fpm.pid).: No such file or directory (2)
69 1
|
3月前
|
应用服务中间件 nginx
Mac Nginx nginx: [error] open() “/usr/local/var/run/nginx.pid“
Mac Nginx nginx: [error] open() “/usr/local/var/run/nginx.pid“
36 1
|
3月前
|
应用服务中间件 nginx
Mac Nginx nginx: [emerg] mkdir() “/usr/local/var/run/nginx/client_body_temp“ failed ...
Mac Nginx nginx: [emerg] mkdir() “/usr/local/var/run/nginx/client_body_temp“ failed ...
91 2
|
3月前
|
应用服务中间件 nginx
Nginx nginx: [emerg] mkdir() "/usr/local/var/run/nginx/client_body_temp"
Nginx nginx: [emerg] mkdir() "/usr/local/var/run/nginx/client_body_temp"
86 0
|
4月前
|
应用服务中间件 nginx
nginx: [emerg] duplicate location “/“ in /usr/local/etc/nginx/nginx.conf:142
nginx: [emerg] duplicate location “/“ in /usr/local/etc/nginx/nginx.conf:142
96 0
|
5月前
|
应用服务中间件 nginx 数据安全/隐私保护
goaccess 分析nginx log
统计AP 使用峰值。客户端访问AP 是通过Nginx 代理实现的。因此可以从Nginx的log着手分析,配合管道命令可以定向分析某些具体请求或者某段时间的nginx log,因此通过goaccess 来分析Nginx可满足需求。
45 0
|
11月前
Cannot lock pid file /usr/local/freeswitch/run/freeswitch.pid.
Cannot lock pid file /usr/local/freeswitch/run/freeswitch.pid.
137 0
|
应用服务中间件 Linux nginx
centos安装nginx 报错:cp: `conf/koi-win' and `/usr/local/nginx/conf/koi-win' are the same file
centos安装nginx 报错:cp: `conf/koi-win' and `/usr/local/nginx/conf/koi-win' are the same file
404 0
|
应用服务中间件 nginx
nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)
nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)
211 0
nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)
|
应用服务中间件 nginx
重启nginx报错:nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed
重启nginx报错:nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed
244 0