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

很多时候会登录一台陌生的服务器;
当需要调整环境的时候;
那真是起步啥都没有;装备全靠打;
两眼一抹黑到处找配置项;
还好我这记的有一份笔记;

可以先总结下;
大都是先用 which 获取目录;
然后再获取配置项位置;

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

ps -ef | grep 'nginx'
Bash


如果没有 那就根据上图中的nginx位置执行

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

nginx和配置项的目录全有了;

ps -ef | grep 'php-fpm'
Bash


配置项文件路径一眼就看到了;

原文地址:https://www.cnblogs.com/datang6777/p/8710238.html