天天看點

Nginx基本操作                                           Nginx基本操作

                                           Nginx基本操作

測試配置檔案

[[email protected] sbin]# ./nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
           

啟動Nginx

[[email protected] sbin]# ps -ef|grep nginx
root      43729      1  0 19:51 ?        00:00:00 nginx: master process ./nginx
nobody    43730  43729  0 19:51 ?        00:00:00 nginx: worker process
root      43732  11870  0 19:51 pts/0    00:00:00 grep --color=auto nginx
           

停止Nginx

[[email protected] sbin]# ./nginx -s stop
[[email protected] sbin]# ps -ef|grep nginx
root      43752  11870  0 19:53 pts/0    00:00:00 grep --color=auto nginx
           

重新開機Nginx

[[email protected] sbin]# ./nginx
[[email protected] sbin]# ps -ef|grep nginx
root      43775      1  0 19:55 ?        00:00:00 nginx: master process ./nginx
nobody    43776  43775  0 19:55 ?        00:00:00 nginx: worker process
root      43786  11870  0 19:55 pts/0    00:00:00 grep --color=auto nginx
[[email protected] sbin]# ./nginx -s reload
[[email protected] sbin]# ps -ef|grep nginx
root      43775      1  0 19:55 ?        00:00:00 nginx: master process ./nginx
nobody    43788  43775  0 19:55 ?        00:00:00 nginx: worker process
root      43790  11870  0 19:55 pts/0    00:00:00 grep --color=auto nginx
           

檢視Nginx程序

[[email protected] sbin]# ps -ef|grep nginx
root      43775      1  0 19:55 ?        00:00:00 nginx: master process ./nginx
nobody    43788  43775  0 19:55 ?        00:00:00 nginx: worker process
root      43790  11870  0 19:55 pts/0    00:00:00 grep --color=auto nginx
           

繼續閱讀