Nginx基本操作
测试配置文件
[root@localhost 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
[root@localhost 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
[root@localhost sbin]# ./nginx -s stop
[root@localhost sbin]# ps -ef|grep nginx
root 43752 11870 0 19:53 pts/0 00:00:00 grep --color=auto nginx
重启Nginx
[root@localhost sbin]# ./nginx
[root@localhost 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
[root@localhost sbin]# ./nginx -s reload
[root@localhost 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进程
[root@localhost 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