centos下nginx关闭后启动失败解决方法

来源:互联网 发布:知乎问答 能挣钱吗 编辑:程序博客网 时间:2024/04/28 03:32

情况:

[root@qwer init.d]# /usr/local/nginx-1.5.1/sbin/nginx -t   (测试配置文件语法是否正确)

nginx: the configuration file /usr/local/nginx-1.5.1//conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx-1.5.1//conf/nginx.conf test is successful

[root@qwer init.d]# /usr/local/nginx-1.5.1/sbin/nginx -s reload (平滑重启)
nginx: [alert] kill(22359, 1) failed (3: No such process)

[root@qwer init.d]# ps -ef|grep nginx
root      22426      1  0 13:44 ?        00:00:08 gedit /usr/local/nginx-1.5.1/logs/access.log
root      22781   5280  0 14:33 pts/2    00:00:00 grep nginx


解决方法:

[root@qwer init.d]# /usr/local/nginx-1.5.1/sbin/nginx -c /usr/local/nginx-1.5.1/conf/nginx.conf    (使用-c指定配置文件)
[root@qwer init.d]# /usr/local/nginx-1.5.1/sbin/nginx -s reload 
[root@qwer init.d]# ps -ef|grep nginx
root      22426      1  0 13:44 ?        00:00:08 gedit /usr/local/nginx-1.5.1/logs/access.log
root      22803      1  0 14:38 ?        00:00:00 nginx: master process /usr/local/nginx-1.5.1/sbin/nginx -c /usr/local/nginx-1.5.1/conf/nginx.conf
nobody    22807  22803  0 14:38 ?        00:00:00 nginx: worker process                                                      
root      22809   5280  0 14:38 pts/2    00:00:00 grep nginx
0 0
原创粉丝点击