一句簡(jiǎn)單命令重啟nginx
最近我的多個(gè)VPS經(jīng)常出現(xiàn)502錯(cuò)誤,經(jīng)常需要重啟nginx,但網(wǎng)上的很多教程都需要繁瑣的啟動(dòng)腳本,遠(yuǎn)不如apache的重啟命令那么簡(jiǎn)單。
但研究了一下nginx幫助后發(fā)現(xiàn),有-s參數(shù)可對(duì)nginx服務(wù)進(jìn)行管理:
# /usr/local/nginx/sbin/nginx -h
nginx version: nginx/0.7.63
Usage: nginx [-?hvVt] [-s signal] [-c filename] [-p prefix] [-g directives]
Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/local/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file
于是我執(zhí)行
# /usr/local/nginx/sbin/nginx -s reload
nginx已經(jīng)重啟成功
用root權(quán)限
#killall nginx
#nginx
其它相關(guān)命令:
1.顯示nginx進(jìn)行id
#ps -aux | grep nginx
2.結(jié)果nginx的master進(jìn)行pid
#kill -HUP 635
3.重啟ngnix
#nginx
關(guān)鍵詞:nginx
閱讀本文后您有什么感想? 已有 人給出評(píng)價(jià)!
- 0
- 0
- 0
- 0
- 0
- 0