zhaojingyu

1. 查看nginx的PID,以常用的80端口为例:

[root@xiaoyuer scripts]# netstat -lntup|grep 80
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      13309/nginx 

#可以知道nginx进程是13309

2. 通过相应的进程ID(比如:13309)查询当前运行的nginx路径:

[root@xiaoyuer scripts]# ll /proc/13309/exe 
lrwxrwxrwx 1 root root 0 Jan  4 17:02 /proc/13309/exe -> /data/nginx/sbin/nginx

 3. 获取到nginx的执行路径后,使用-t参数即可获取该进程对应的配置文件路径,如:

/usr/local/nginx/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

 其实所有的启动命令都是类似 

分类:

技术点:

相关文章:

  • 2022-02-12
  • 2021-08-05
  • 2021-09-17
  • 2022-02-25
  • 2022-01-07
  • 2022-12-23
  • 2022-01-08
猜你喜欢
  • 2021-12-03
  • 2021-12-25
  • 2021-09-19
相关资源
相似解决方案