View nginx, apache, php, mysql configuration file paths in Centos

1. Judging that apache
first execute the command to find the httpd path
ps  aux | grep httpd
If the httpd path is /usr/local/apache/bin/httpd
and then execute the following command
/usr/local/apache/bin/httpd -V | grep "SERVER_CONFIG_FILE" You
can find the configuration file path loaded at compile time httpd.conf
-V parameter can see the parameters configured at compile time


2. Judging nginx
First execute the command to find the nginx path
ps aux | grep nginx
If the nginx path is
/usr/local/nginx/sbin/nginx
and then execute the following command
/usr/local/nginx/sbin/nginx -V
is placed in the installation directory by default under conf/nginx.conf


3. To judge mysql,
first execute the command to find the mysql path
ps aux | grep mysqld
If the mysqld path is
/usr/bin/mysql
and then execute the following command
/usr/bin/mysql –verbose –help | grep -A 1 'Default options'
or
/ usr/bin/mysql --print-defaults


4. Determine the path of the configuration file loaded
by php (1), you can view it through the php function phpinfo, write a file, and then use the URL to access it, find the value corresponding to "Loaded Configuration File", which is the configuration file loaded by php
(2) , If it is nginx+ php configuration , you can also find the php execution path
ps aux | grep php
For example, the path is /usr/local/nginx/sbin/php-fpm
and then execute the following command
/usr/local/nginx/sbin/php- fpm -i | grep "Loaded Configuration File"
to see the configuration file loaded by php
(3). If it is apache+mod_php configuration, you can also view the loaded php.ini path in the apache configuration file. For example, PHPIniDir "/usr/local/apache/conf/php.ini"
, of course, there is also a simple method, which is to search through find,
such as
find / -name nginx.conf
find / -name php.ini
find / -name my.cnf
find / -name httpd.conf
This kind of search can only be done by brushing

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326823050&siteId=291194637