The method of viewing nginx, apache, php, mysql configuration file paths in linux

How to view nginx, apache, php, mysql configuration file paths in linux, if you receive an environment configured by others, but leave no relevant documents. At this time how to judge to find the correct path to load the file. You can judge by the following 1. To judge 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" to find the configuration file path loaded at compile time httpd.conf -V parameter to see the parameters configured at compile time

2. Judge nginx First execute the command to find the nginx path ps aux | grep nginx If the nginx path is /usr/local/nginx/sbin/nginx

Then execute the following command /usr/local/nginx/sbin/nginx -V by default in the installation directory conf/nginx.conf 3. Determine mysql First execute the command to find the mysql path ps aux | grep mysqld For example, the mysqld path is /usr/bin /mysql

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 visit it with the URL, 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" You can 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. Such as 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 method needs to be selected by brushing.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325652411&siteId=291194637