Admin-Ahead Community

Linux => General Linux => Topic started by: sibij on July 28, 2018, 01:47:21 pm

Title: How to Find MySQL, PHP and Apache Configuration Files:awk and sed
Post by: sibij on July 28, 2018, 01:47:21 pm
Check configuration file of mysql, php, nginx
Code: [Select]
$ mysql --help | awk '$0~/Default options/{getline;print}'
/etc/my.cnf ~/.my.cnf
$ mysqladmin --help | awk '$0~/Default options/{getline;print}'
/etc/my.cnf ~/.my.cnf

Check PHP Configuration File.
Code: [Select]
$ php -i | awk '$0~/^Loaded Configuration File/{print $NF}'
/etc/php.ini

Check Nginx Configuration File.

$ nginx -V 2>&1 | sed -r -n 's@.*conf-path=(.*) --error.*@\1@p'
/etc/nginx/nginx.conf