1.nginx的常用命令
1.查看nginx的版本号
./nginx -v
[root@Nginx-node1 sbin]# ./nginx -v
nginx version: nginx/1.18.0
[root@Nginx-node1 sbin]#
2.启动nginx
./nginx
[root@Nginx-node1 sbin]# ps -ef|grep nginx
root 3686 1 0 02:03 ? 00:00:00 nginx: master process ./nginx
nobody 3687 3686 0 02:03 ? 00:00:00 nginx: worker process
root 24830 970 0 02:24 pts/0 00:00:00 grep --color=auto nginx
[root@Nginx-node1 sbin]# ./nginx -s stop
[root@Nginx-node1 sbin]# ps -ef|grep nginx
root 24834 970 0 02:25 pts/0 00:00:00 grep --color=auto nginx
[root@Nginx-node1 sbin]#
3.关闭nginx
./nginx -s stop
[root@Nginx-node1 sbin]# ps -ef|grep nginx
root 3686 1 0 02:03 ? 00:00:00 nginx: master process ./nginx
nobody 3687 3686 0 02:03 ? 00:00:00 nginx: worker process
root 24830 970 0 02:24 pts/0 00:00:00 grep --color=auto nginx
[root@Nginx-node1 sbin]# ./nginx -s stop
[root@Nginx-node1 sbin]# ps -ef|grep nginx
root 24834 970 0 02:25 pts/0 00:00:00 grep --color=auto nginx
[root@Nginx-node1 sbin]#
4.重新加载nginx(在修改了nginx.conf配置文件后,不需要关闭nginx,直接重新加载配置文件就生效,比较有用)
./nginx -s reload
网友评论