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 or directory)

解决办法,执行以下语法即可修复:

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

  原理:

使用nginx -c的参数指定nginx.conf文件的位置
————————————————
版权声明:本文为CSDN博主「Java高知」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/tjcyjd/article/details/69683360

原文地址:https://www.cnblogs.com/lrzy/p/12100155.html

时间: 2024-10-08 01:57:41

nginx 首旅之坑(/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: [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

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

nginx: [emerg] unknown directive “ ” in /usr/local/nginx/nginx.conf.conf:xx报错处理

当我们在修改Nginx的配置文件,然后加载配置文件./nginx -s reload   报错类似的错误, nginx: [emerg] unknown directive “ ” in /usr/local/nginx/nginx.conf.conf:xx报错处理 那么,大多数我们就是配置刚刚写的这句代码的时候,多打了个空格,细心找一下,重写下就ok了! 原文地址:https://www.cnblogs.com/arebirth/p/errornginx01.html

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