yecho 发表于 2010 年 10 月 2 日 18:22:32

Nginx热重启


用过Nginx的都知道,热重启是个很重要的功能,假设你没有使用init的启动脚本来控制Nginx的启动,那么就必须通过手动方式来热重启Nginx了,这里提供一种简单的方法。首先找到Nginx的pid,sudo
ps
-ef|grep
nginx

root      3909 136500 00:35 pts/0    00:00:00 grep nginx
root      5875   10 Mar28 ?      00:00:00 nginx: master process /usr/local/nginx/sbin/nginx
nobody    587758750 Mar28 ?      00:00:19 nginx: worker process
nobody    587858750 Mar28 ?      00:00:17 nginx: worker process
nobody    588058750 Mar28 ?      00:00:18 nginx: worker process
nobody    588258750 Mar28 ?      00:00:17 nginx: worker process

然后热重启,sudo
kill
-HUP
5875

记得替换pid为你自己机器上nginx进程的pid。

页: [1]
查看完整版本: Nginx热重启