Nginx從入門到實戰(三):常用命令

前序:
Nginx從入門到實戰(一):介紹
Nginx從入門到實戰(二):Linux安裝Nginx

Nginx常用命令

1.查看版本號

[root@localhost sbin]# ./nginx -v
nginx version: nginx/1.12.2

2.啓動nginx

[root@localhost sbin]# ./nginx
[root@localhost sbin]# ps -ef | grep nginx
root     17340     1  0 13:10 ?        00:00:00 nginx: master process ./nginx
nobody   17341 17340  0 13:10 ?        00:00:00 nginx: worker process
root     17343 13527  0 13:10 pts/0    00:00:00 grep --color=auto nginx

3.關閉nginx

[root@localhost sbin]# ./nginx -s stop
[root@localhost sbin]# ps -ef | grep nginx
root     17330 13527  0 13:10 pts/0    00:00:00 grep --color=auto nginx

4.重新加載nginx(修改配置文件重新加載)

[root@localhost sbin]# ./nginx -s reload
[root@localhost sbin]# ps -ef | grep nginx
root     17340     1  0 13:10 ?        00:00:00 nginx: master process ./nginx
nobody   17358 17340  0 13:12 ?        00:00:00 nginx: worker process
root     17360 13527  0 13:12 pts/0    00:00:00 grep --color=auto nginx
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章