美文网首页
Nginx的常用命令

Nginx的常用命令

作者: 月下饿狼 | 来源:发表于2020-07-17 10:31 被阅读0次

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

相关文章

网友评论

      本文标题:Nginx的常用命令

      本文链接:https://www.haomeiwen.com/subject/yvnwhktx.html