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

相关文章
相关标签/搜索