步驟1:查詢nginx主進程號
ps -ef | grep nginx
在進程列表裡 面找master進程,它的編號就是主進程號了。
步驟2:停止nginx
從容停止Nginx:
kill -QUIT 主程序號碼
快速停止Nginx:
kill -TERM 主進程號
強制停止Nginx:
pkill -9 nginx
步驟3:啟動nginx
環境1:
[root@iZ25yepqfvvZ /]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
[root@iZ25yepqfvvZ /]
[root@iZ25yepqfvvZ /]
[root@iZ25yepqfvvZ /]
- g#nginx
root 18798 1 0 16:35 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
root 18799 18798 0 16:35 ? 00:00:00 nginx: worker process
root 18801 18798 0 16:35 ? 00:00:00 nginx: worker process
root 18802 18798 0 16:35 ? 00:00:00 nginx: worker process
環境2
[root@iZ25yepqfvvZ /]# /usr/sbin/nginx -c /etc/nginx/nginx.conf
[root@iZ25knm9r1gZ ~]# ps -ef | grep nginx
root 28969 1 0 16:50 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx 28970 28969 0 16:50 ? 00:00:00 nginx: worker process
nginx 28974 28969 0 16:50 ? 00:00:00 nginx: worker process
root 29419 29401 0 17:11 pts/0 00:00:00 grep nginx 🎜 以上就介紹了linux環境停止和啟動nginx,包括了方面的內容,希望對PHP教程有興趣的朋友有所幫助。 🎜 🎜 🎜