日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Nginx >内容正文

Nginx

04_Nginx命令行参数,控制信号,Nginx启动、停止、重启命令

發布時間:2024/9/27 Nginx 69 豆豆
生活随笔 收集整理的這篇文章主要介紹了 04_Nginx命令行参数,控制信号,Nginx启动、停止、重启命令 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.


Nginx支持一下命令行參數

-? | -h?? 打印出命令行參數的幫助

[root@localhost nginx]# ./nginx -?

nginx version: nginx/1.8.0

Usage: nginx [-?hvVtq] [-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

? -q??????????? : suppress non-error messages during configuration testing

? -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: /usr/local/nginx/nginx.conf)

? -g directives : set global directives out of configuration file

[root@localhost nginx]# ./nginx -h

nginx version: nginx/1.8.0

Usage: nginx [-?hvVtq] [-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

? -q??????????? : suppress non-error messages during configuration testing

? -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: /usr/local/nginx/nginx.conf)

? -g directives : set global directives out of configuration file

?

-c file? 使用可用的配置文件而不是默認的文件

[root@localhost nginx]# pwd

/usr/local/nginx

[root@localhost nginx]# ls

client_body_temp??????? fastcgi_temp? mime.types.default? sbin????????????????? uwsgi_temp

conf??????????????????? html????????? nginx?????????????? scgi_params?????????? win-utf

fastcgi.conf???? ???????koi-utf?????? nginx.bak?????????? scgi_params.default

fastcgi.conf.default??? koi-win?????? nginx.conf????????? scgi_temp

fastcgi_params????????? logs????????? nginx.conf.default? uwsgi_params

fastcgi_params.default? mime.types??? proxy_temp??????? ??uwsgi_params.default

[root@localhost nginx]# ./nginx -c nginx.conf

[root@localhost nginx]#

-t 不運行,而僅僅測試配置文件。Nginx將檢查配置文件的語法的正確性,并嘗試打開配置文件中所有引用的文件。

[root@localhost nginx]# ./nginx -t

nginx: the configuration file /usr/local/nginx/nginx.conf syntax is ok

nginx: configuration file /usr/local/nginx/nginx.conf test is successful

-v顯示nginx的版本

[root@localhost nginx]# ./nginx -v

nginx version: nginx/1.8.0

-V顯示nginx的版本,編譯器版本和配置參數

[root@localhost nginx]# ./nginx -V

nginx version: nginx/1.8.0

built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)

built with OpenSSL 1.0.1c 10 May 2012

TLS SNI support enabled

configure arguments: --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_stub_status_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-http_spdy_module --with-ipv6 --with-pcre=../pcre-8.37 --with-zlib=../zlib-1.2.8 --with-openssl=../openssl-1.0.1c --user=nginx --group=nginx

[root@localhost nginx]#

-s signal 發送一個信號給主進程,這些參數可以以下的參數中的一個:

./nginx –s stop

快速關閉

./nginx –s quit

優雅關閉

./nginx –s reload

重新加載配置文件,使用一個新的worker進程啟動一個新的worker進程,優雅的關閉舊的worker進程。

./nginx –s reopen

重新打開日志文件

?

Nginx控制信號

可以使用信號系統來控制主進程。默認,nginx將其主進程的pid寫入到/usr/local/nginx/nginx.pid文件中。通常傳遞參數給./configure或使用pid指令,來改變文件的位置。

主進程可以處理以下的信號:

TERM,INT

快速關閉

QUIT

從容關閉

HUP

重載配置

用新的配置開始新的工作進程從容關閉舊的工作進程。

USR1

重新打開日志文件

USR2

平滑升級可執行程序

WINCH

從容關閉工作進程

盡管你不幣自己操作工作進程,但是,它們也支持一些信號:

TERM,INT

快速關閉

QUIT

從容關閉

USR1

重新打開日志文件

?

Nginx啟動、停止、重啟命令

Nginx啟動

[root@localhost nginx]# pwd

/usr/local/nginx

[root@localhost nginx]# ls

client_body_temp??????? fastcgi_temp? mime.types.default? sbin????????????????? uwsgi_temp

conf??????????????????? html?????? ???nginx?????????????? scgi_params?????????? win-utf

fastcgi.conf??????????? koi-utf?????? nginx.bak?????????? scgi_params.default

fastcgi.conf.default??? koi-win?????? nginx.conf????????? scgi_temp

fastcgi_params????????? logs????????? nginx.conf.default ?uwsgi_params

fastcgi_params.default? mime.types??? proxy_temp????????? uwsgi_params.default

[root@localhost nginx]# ./nginx

[root@localhost nginx]#

Nginx從容停止命令,等待所有請求結束后關閉服務:

ps –ef | grep nginx

kill –QUIT nginx主進程號

[root@localhost nginx]# ps -ef | grep nginx

root???? 18252???? 1? 0 15:35 ???????? 00:00:00 nginx: master process ./nginx

nginx??? 18253 18252? 0 15:35 ???????? 00:00:00 nginx: worker process

nginx??? 18254 18252? 0 15:35 ???????? 00:00:00 nginx: worker process

root???? 18304 14028? 0 15:37 pts/0??? 00:00:00 grep nginx

[root@localhost nginx]# kill -QUIT 18252

[root@localhost nginx]# ps -ef | grep nginx

root???? 18389 14028? 0 15:40 pts/0??? 00:00:00 grep nginx

[root@localhost nginx]# ./nginx

[root@localhost nginx]# ps -ef | grep nginx

root???? 18393???? 1? 0 15:40 ???????? 00:00:00 nginx: master process ./nginx

nginx??? 18394 18393? 0 15:40 ???????? 00:00:00 nginx: worker process

nginx??? 18395 18393? 0 15:40 ???????? 00:00:00 nginx: worker process

root???? 18399 14028? 0 15:40 pts/0??? 00:00:00 grep nginx

[root@localhost nginx]# kill -QUIT `cat /usr/local/nginx/nginx.pid`

[root@localhost nginx]# ps -ef | grep nginx

root???? 18447 14028? 0 15:42 pts/0??? 00:00:00 grep nginx

[root@localhost nginx]#

?

Nginx快速停止命令,立刻關閉nginx進程

ps -ef | grep nginx

kill –TERM nginx主進程號

[root@localhost nginx]# ./nginx

[root@localhost nginx]# ps -ef | grep nginx

root???? 18503???? 1? 0 15:44 ???????? 00:00:00 nginx: master process ./nginx

nginx??? 18504 18503? 0 15:44 ???????? 00:00:00 nginx: worker process

nginx??? 18505 18503? 0 15:44 ???????? 00:00:00 nginx: worker process

root???? 18508 14028? 0 15:44 pts/0??? 00:00:00 grep nginx

[root@localhost nginx]# kill -TERM 18503

[root@localhost nginx]# ps -ef | grep nginx

root???? 18557 14028? 0 15:46 pts/0??? 00:00:00 grep nginx

[root@localhost nginx]#

如果以上命令不管用,可以強制停止:

Kill -9 nginx主進程號

?

如果嫌麻煩可以不用查看進程號,直接使用命令進行操作

其中/usr/local/nginx/nginx.pidnginx.conf中的pid命令設置的參數,用來存放nginx主進程號的文件

Kill –信號類型(HUP|TERM|QUIT) `cat /usr/local/nginx/nginx.pid`

例如:

kill -QUIT `cat/usr/local/nginx/nginx.pid`

?

nginx重啟命令:

1簡單型,先關閉進程,修改你的配置后,重啟進程。

kill -QUIT `cat/usr/local/nginx/nginx.pid`

./nginx

?

2 重新加載配置文件,不重啟進程,不會停止處理請求

3 平滑更新nginx二進制,不會停止處理請求

?

?

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的04_Nginx命令行参数,控制信号,Nginx启动、停止、重启命令的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 亚洲天堂91 | 狠狠亚洲| 欧美性网站 | 爱草在线视频 | 日韩中文字幕免费视频 | 奇米影视网 | 久久国产亚洲精品无码 | 亚洲日本香蕉 | 少妇裸体挤奶汁奶水视频 | 在线免费观看日本 | 专干老肥女人88av | 99精品视频在线看 | 99久久久久久久久久 | 兔费看少妇性l交大片免费 日韩高清不卡 | 少妇扒开粉嫩小泬视频 | 狠狠操狠狠 | 2019中文字幕在线观看 | 亚洲精品天堂成人片av在线播放 | 婷婷五月综合久久中文字幕 | 国产欧美日韩三区 | 黄色大片在线播放 | 日本va在线观看 | 超碰超碰 | 精品国产乱码久久久久久图片 | 性色tv | 成人精品视频一区二区 | 国产精品久久久久一区二区三区 | 婷婷开心激情网 | 国产一区二区三区 | 欧美xxxx精品 | 经典三级第一页 | 思思99精品视频在线观看 | 欧美日韩视频网站 | 免费中文字幕日韩欧美 | 91麻豆蜜桃一区二区三区 | 69国产精品视频 | 国产a级片视频 | 婷婷午夜影院 | 国产视频一区二区不卡 | 亚洲成人久久久 | 在线观看亚洲av每日更新 | 国产一级一级片 | 调教小屁屁白丝丨vk | 中文幕无线码中文字夫妻 | 午夜久久乐 | 欧美xxxx视频 | 国产精品毛片一区视频播 | 国内久久 | 色婷婷精品久久二区二区密 | 久一精品 | 久操福利 | 色妞色视频一区二区三区四区 | 毛片少妇| 色哟哟精品观看 | 草草在线视频 | 久久国产影院 | 亚洲av无码日韩精品影片 | 成年人在线网站 | 日韩欧美高清在线 | 伊人久久大香线蕉 | 精品国产91久久久久久 | 18禁免费观看网站 | 国产日皮视频 | 男人把女人捅爽 | 欧美图片自拍偷拍 | 久久久久国产精品区片区无码 | 99热这里只有精 | 女性私密整形视频 | 国产精品网站入口 | 五月开心网 | 亚洲精品网站在线 | 青青草av在线播放 | 天天曰天天 | 精品国产一二 | 色久天 | 精品熟妇一区二区三区 | 日本色一区| 老湿机69福利区午夜x片 | 亚洲成av人片久久 | 国产精品www色诱视频 | 午夜精品一区 | 亚洲伦理自拍 | www.三级 | 免费美女av | 成人a视频在线观看 | 交专区videossex农村 | 诱惑の诱惑筱田优在线播放 | 玖玖伊人| 亚洲成人tv| 综合精品久久 | 国产va在线观看 | 在线观看欧美视频 | 亚洲综合图片一区 | 国产成人无码精品久在线观看 | 色噜噜狠狠成人中文 | 国内免费毛片 | 中文字幕高潮 | 97超碰人人草 | 欧美a v在线播放 |