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服務
[root@localhost ~]# nginx安裝目錄 -c nginx.conf配置文件目錄
參數 “-c” 指定了配置文件的路徑,如果不加 “-c” 參數,Nginx 會默認加載其安裝目錄的 conf 子目錄中的 nginx.conf 文件。