Nginx常用命令

1、查看当前运行的配置文件 

[root@syjmw-app-13 ~]# netstat -anop | grep 0.0.0.0:80
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      16463/nginx         off (0.00/0/0)
tcp        0      0 0.0.0.0:8001                0.0.0.0:*                   LISTEN      7815/java           off (0.00/0/0)
[root@syjmw-app-13 ~]# ll /proc/16463/exe
lrwxrwxrwx. 1 root root 0 4月  26 04:10 /proc/16463/exe -> /hnisi/local/nginx/nginx
[root@syjmw-app-13 ~]# /hnisi/local/nginx/nginx -t
nginx: the configuration file /hnisi/local/nginx/nginx.conf syntax is ok
nginx: configuration file /hnisi/local/nginx/nginx.conf test is successful

 2、查看当前运行nginx的进程号

[root@syjmw-app-13 ~]# ps -ef | grep nginx
root     16463     1  0 Apr25 ?        00:00:00 nginx: master process ./nginx
root     20172 19460  0 19:12 pts/0    00:00:00 grep nginx
nobody   24161 16463  0 Apr25 ?        00:00:18 nginx: worker process
nobody   24162 16463  0 Apr25 ?        00:00:24 nginx: worker process

3、nginx启动、重启、停止命令

从容地重启:kill -HUP pid
启动nginx:./nginx
重启nginx:./nginx -s reload
停止nginx:./nginx -s stop

4、查出nginx的PID->通过PID查出端口号

[root@syjmw-app-13 ~]# ps -ef | grep nginx
root     16463     1  0 Apr25 ?        00:00:00 nginx: master process ./nginx
root     20827 19460  0 19:33 pts/0    00:00:00 grep nginx
nobody   24161 16463  0 Apr25 ?        00:00:18 nginx: worker process
nobody   24162 16463  0 Apr25 ?        00:00:24 nginx: worker process
[root@syjmw-app-13 ~]# netstat -antup | grep 16463
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      16463/nginx        

 

posted on 2017-04-25 00:14 流易 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/boazy/p/6759923.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值