Linux中查找nginx安装目录和nginx.conf配置文件目录

1.查看nginx安装目录

在shell中输入命令

# ps -ef | grep nginx

返回结果

root      4593     1  0 Jan23 ?        00:00:00 nginx: master process /usr/sbin/nginx

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

在shell中输入命令

# 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服务

输入命令

# nginx安装目录 -c nginx.conf配置文件目录

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



版权声明:本文为jian_xi原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。