解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)错误

服务器重启后,重启nginx时报错nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory),进入到logs目录发现确实没有nginx.pid文件

cd /usr/local/nginx/sbin/
./nginx -s reload
ngx_http_fastdfs_set pid=1412
ngx_http_fastdfs_set pid=1412
ngx_http_fastdfs_set pid=1412
ngx_http_fastdfs_set pid=1412
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

解决办法

使用指定nginx.conf文件的方式重启nginx

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

此时去logs目录下查看发现nginx.pid文件已经生成了

原文地址:https://www.cnblogs.com/chengfengchi/p/11393372.html

时间: 2024-10-14 04:38:26

解决nginx: [error] open() "/usr/local/nginx/logs/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)

nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory) 2017年09月14日 09:15:45 阅读数:7742 启动Nginx出现这个错误 nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory) 1  解决方法:找

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

问题场景 服务器重启后,重启nginx时报错nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory),进入到logs目录发现确实没有nginx.pid文件 解决办法 使用指定nginx.conf文件的方式重启nginx /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf还有一种可能就

nginx 首旅之坑(/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory))

第一次按教程安装nginx ,启动NGINX时出错,百度解决方法如下: ========================= 需要停止或者重启nginx的命令如下 /usr/local/nginx/sbin/nginx -s stop /usr/local/nginx/sbin/nginx -s reload 发现报以下错误: nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file o

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

在重启nginx服务的时候,出现了这个错误. [[email protected] etc]# nginx -c /var/run/nginx/nginx.pid nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory) 解决办法: [[email protected] etc]# nginx -c /etc/nginx/nginx.conf 其他的一些解决办法: 1.进

-bash: /usr/local/Java/jdk1.8.0_241/bin/java: No such file or directory

错误: [[email protected] Java]# java -version -bash: /usr/local/Java/jdk1.8.0_241/bin/java: No such file or directory 原因:64位操作系统装了32为,重新装一个64位即可,在Linux中64位只能装64位 Linux中查看位数的命令: [[email protected] ~]# getconf LONG_BIT 64 [[email protected] ~]# 原文地址:http

nginx 启动出现 [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

1.nginx 启动出现: 2.打开nginx.conf配置文件,把下面红色部分打开,重启服务器或者重新加载配置文件,这样nginx.pid路径就更改成功! 3. 在sbin/ 路径下执行  ./nginx -c /usr/local/nginx/conf/nginx.conf 出现问题 这个问题是端口被占用 根据Nginx配置文件查看配置的端口(本文中使用的是80端口),然后根据端口查看端口占用情况 . 使用kill命令杀死占用进程,之后重新启动Nginx kill -9 12256 重新启动

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

在Mac上用brew安装Nginx,然后修改Nginx配置文件,再重启时报出如下错误: nginx: [error] invalid PID number "" in "/usr/local/var/run/nginx/nginx.pid" 解决办法: $ sudo nginx -c /usr/local/etc/nginx/nginx.conf $ sudo nginx -s reload

touch: cannot touch '/usr/local/tomcat/logs/catalina.out': Permission denied解决方法

logs目录没有创建修改权限 ./startup.sh Using CATALINA_BASE:   /usr/local/tomcat702 Using CATALINA_HOME:   /usr/local/tomcat702 Using CATALINA_TMPDIR: /usr/local/tomcat702/temp Using JRE_HOME:        /usr/java/jdk1.6.0_24 Using CLASSPATH:       /usr/local/tomcat

nagios Permission denied: exec of '/usr/local/nagios/sbin/status.cgi' failed, referer:

nagios   出现nagios Permission denied类似的报错,具体报错我贴在下面,这样的原因就是selinux没关.关闭即可 1.临时关闭(不用重启机器): setenforce 0                  ##设置SELinux 成为permissive模式 ##setenforce 1 设置SELinux 成为enforcing模式 2.修改配置文件需要重启机器: 修改/etc/selinux/config 文件 将SELINUX=enforcing改为SELI