nginx停止,平滑重启命令
生活随笔
收集整理的這篇文章主要介紹了
nginx停止,平滑重启命令
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
TERM, INT 快速關(guān)閉;
QUIT 從容關(guān)閉;
HUP 平滑重啟,重新加載配置文件;
USR1 重新打開日志文件,在切割日志時(shí)用途較大;
USR2 平滑升級(jí)可執(zhí)行程序;
WINCH 從容關(guān)閉工作進(jìn)程;
【荔枝】
[root@localhost nginx]# nginx -c conf/nginx.conf [root@localhost nginx]# [root@localhost nginx]# ps -ef | grep nginx root 2138 1 0 06:30 ? 00:00:00 nginx: master process nginx -c conf/nginx.conf nobody 2139 2138 0 06:30 ? 00:00:00 nginx: worker process nobody 2140 2138 0 06:30 ? 00:00:00 nginx: worker process nobody 2141 2138 0 06:30 ? 00:00:00 nginx: worker process root 2143 2083 1 06:30 pts/0 00:00:00 grep nginx [root@localhost nginx]# [root@localhost nginx]# ps -ef | grep nginx root 2138 1 0 06:30 ? 00:00:00 nginx: master process nginx -c conf/nginx.conf nobody 2139 2138 0 06:30 ? 00:00:00 nginx: worker process nobody 2140 2138 0 06:30 ? 00:00:00 nginx: worker process nobody 2141 2138 0 06:30 ? 00:00:00 nginx: worker process root 2147 2083 3 06:32 pts/0 00:00:00 grep nginx [root@localhost nginx]# [root@localhost nginx]# kill -QUIT 2138 [root@localhost nginx]# [root@localhost nginx]# ps -ef | grep nginx root 2149 2083 2 06:32 pts/0 00:00:00 grep nginx
【nginx.conf 文件如下】: 第2行的 woker_processes 3; 表示nginx主進(jìn)程 帶有3個(gè)工作進(jìn)程;
# this config is from 3-6 worker_processes 3; events {worker_connections 1024; } http {# first virtual host 第一個(gè)虛擬主機(jī)server{# ip and port monitored 監(jiān)聽的ip和端口listen 192.168.186.100:80;# host name 主機(jī)名稱server_name 192.168.186.100;# the dir access_log saved 訪問日志文件存放路徑access_log logs/server1.access.log combined;location /{# default index file, priority reduction from left to right# 默認(rèn)首頁文件,順序從左到右,index index.html index.htm;# the dir html file saved, html網(wǎng)頁文件存放目錄root /data0/htdocs/server1;}}# second virtual hostserver{listen 192.168.186.101:80;server_name 192.168.186.101;access_log logs/server2.access.log combined;location /{index index.html index.htm;root /data0/htdocs/server2;}}# third virtual hostserver {listen 192.168.186.102:80;server_name 192.168.186.102;access_log logs/server3.access.log combined;location /{index index.html index.htm;root /data0/htdocs/server3.com;}} }創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)
總結(jié)
以上是生活随笔為你收集整理的nginx停止,平滑重启命令的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 基于linux的系统必须开源吗(基于li
- 下一篇: nginx的日志文件配置