nginx 常用的命令
1.nginx操作命令的前提条件
必须进入nginx的目录里面去,才能执行命令
[root@localhost ~]# cd /usr/local
[root@localhost sbin]# pwd
/usr/local/nginx/sbin
2.查看nginx的版本号
[root@localhost sbin]# ./nginx -v
nginx version: nginx/1.12.2
3.启动nginx
[root@localhost sbin]# ./nginx
[root@localhost sbin]# ps -ef |grep nginx
root 3105 1 0 22:44 ? 00:00:00 nginx: master process ./nginx
nobody 3106 3105 0 22:44 ? 00:00:00 nginx: worker process
root 3108 3054 0 22:44 pts/0 00:00:00 grep nginx
4.关闭nginx
[root@localhost sbin]# ./nginx -s stop
5.重新加载nginx
当文件修改时,需要重载nginx
/usr/local/nginx/conf/nginx.conf
重新加载命令为:
./nginx -s reload