linux查看nginx、apache、php、php-fpm、mysql及配置項所在目錄

 

不少時候會登陸一臺陌生的服務器;
當須要調整環境的時候;
那真是起步啥都沒有;裝備全靠打;
兩眼一抹黑處處找配置項;
還好我這記的有一份筆記;php

能夠先總結下;
大都是先用 which 獲取目錄;
而後再獲取配置項位置;mysql

which  mysql
/usr/bin/mysql
/usr/bin/mysql --help | grep -A1 'Default options'
Bash

which php
/usr/local/apache2/php/bin/php
php -i | grep "Loaded Configuration File"
Bash

ps -ef | grep 'http'
/usr/local/apache2/bin/httpd -V | grep 'SERVER_CONFIG_FILE'
Bash

拼起來就是: /usr/local/apache2/conf/httpd.conf

nginx

ps -ef | grep 'nginx'
Bash


若是沒有 那就根據上圖中的nginx位置執行sql

/www/server/nginx/sbin/nginx -t
Bash

nginx和配置項的目錄全有了;apache

ps -ef | grep 'php-fpm'
Bash


配置項文件路徑一眼就看到了;bash

相關文章
相關標籤/搜索