對于一臺陌生的服務器或安裝太久忘了位置,怎么才能簡單快速的找到配置文件的位置呢?要找出配置文件的位置,需要先找出nginx可執(zhí)行文件的路徑 , 這里有幾種方法:
1、如果程序在運行中 ps -ef | grep nginx # ps -ef | grep nginx root 29514...
對于一臺陌生的服務器或安裝太久忘了位置,怎么才能簡單快速的找到配置文件的位置呢?
要找出配置文件的位置,需要先找出nginx可執(zhí)行文件的路徑 ,
這里有幾種方法:
1、如果程序在運行中
ps -ef | grep nginx # ps -ef | grep nginx root 29514 1 0 Mar01 ? 00:00:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on; www-data 29515 29514 0 Mar01 ? 00:00:00 nginx: worker process root 30276 28948 0 09:36 pts/1 00:00:00 grep --color=auto nginx
通常是 /usr/sbin/nginx
2、程序并沒有運行
查看軟件安裝路徑
whereis nginx
查詢運行文件所在路徑
which nginx
當然還有另外的查詢方法
rpm包安裝的,可以用rpm -qa | grep “軟件或者包的名字”查詢;
yum方法安裝的,可以用yum list installed查找;
獲取配置文件位置
通過上面的一些方法,找到了nginx可執(zhí)行文件的路徑,就可以通過Nginx自身的功能找到配置文件的位置了。
# /usr/sbin/nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
你還有更好的方法嗎?
總結
以上所述是小編給大家介紹的找出nginx配置文件的所在位置的方法詳解,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!