Linux 服务器上如何查找 nginx 的安装路径?

木马猎人 9月前  服务器   413

刚刚需要修改网站的 nginx 伪静态配置,于是登录到 VPS 主机,可是 nginx 的安装目录不记得了,怎么样快速查找?

2 个回答
  • 小何同志 9月前
    2
    最简单的方法是用 ps -ef | grep nginx 命令:

    [root@HQW-Aliyun ~]# ps -ef | grep nginx
    root       908     1  0 Aug09 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
    www        910   908  0 Aug09 ?        00:21:28 nginx: worker process                                          
    root      9586  9279  0 11:33 pts/0    00:00:00 grep nginx
    2 回复引用 引用
  • 野溜小子 9月前
    3
    还可以使用 nginx -t 命令:
    [root@Aliyun ~]# 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
    2 回复引用 引用
    • 探知网
      4
        立即登录 立即注册
返回
发新帖