Linux下怎么确定Nginx安装目录

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux下怎么确定Nginx安装目录相关的知识,希望对你有一定的参考价值。

参考技术A 看你的nginx是否启动了?
如果启动了,用ps -ef|grep nginx可以查看到nginx运行目录
如果没有启动,用find / -name nginx查看本回答被提问者采纳
参考技术B 命令: whereis nginx

linux系统下nginx安装目录和nginx.conf配置文件目录

linux系统下nginx安装目录和nginx.conf配置文件目录

1、查看nginx安装目录

输入命令

# ps  -ef | grep nginx

返回结果包含安装目录

root      2662     1  0 07:12 ?        00:00:00 nginx: master process /usr/sbin/nginx

2、查看nginx.conf配置文件目录

输入命令

# nginx -t

返回结果包含配置文件目录

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok

nginx: configuration file /etc/nginx/nginx.conf test is successful

3、启动nginx服务

[[email protected] ~]# nginx安装目录 -c nginx.conf配置文件目录

参数 “-c” 指定了配置文件的路径,如果不加 “-c” 参数,Nginx 会默认加载其安装目录的 conf 子目录中的 nginx.conf 文件。

以上是关于Linux下怎么确定Nginx安装目录的主要内容,如果未能解决你的问题,请参考以下文章

Linux下怎么确定Nginx安装目录

Linux下怎么确定Nginx安装目录

Linux下怎么确定Nginx安装目录

Linux下查看Nginx安装目录版本号信息?

Linux下查看Nginx安装目录版本号信息?

Linux下查看Nginx安装目录版本号信息及当前运行的配置文件