View Nginx, Apache, PHP, mysql configuration file path instances in Linux

Source: Internet
Author: User
Tags phpinfo
How to view Nginx, Apache, PHP, MySQL configuration file paths in Linux, if you receive an environment that someone else has configured, but leave no documentation. At this point how to determine the correct load file path is found. Can be judged by the following.

1. Judging Apache
First execute the command to find the httpd path
PS aux | grep httpd
If the httpd path is/USR/LOCAL/APACHE/BIN/HTTPD
Then execute the following command
/usr/local/apache/bin/httpd-v | grep "Server_config_file"
To find the configuration file path that was loaded at compile time httpd.conf
The-v parameter can see the parameters that are 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

Then execute the following command
/usr/local/nginx/sbin/nginx-v
By default in the installation directory conf/nginx.conf
3. Judging MySQL
First execute the command to find the MySQL path
PS aux | grep mysqld
If 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 PHP load profile path
(1), can be viewed through PHP function phpinfo, write a file, and then use the URL to access, find "Loaded configuration file" corresponding to the value of the PHP loaded configuration files
(2), if it is a 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
Then execute the following command
/usr/local/nginx/sbin/php-fpm-i | grep "Loaded Configuration File"
You can see the PHP loaded configuration file
(3), if it is a 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 a simple way to search through find.
Such as
Find/-name nginx.conf
Find/-name php.ini
Find/-name MY.CNF
Find/-name httpd.conf

This is going to be done by brush.

Original: http://www.phper163.com/archives/368

How to view Nginx, Apache, PHP, MySQL configuration file paths in Linux, if you receive an environment that someone else has configured, but leave no documentation. At this point how to determine the correct load file path is found. You can use the following to determine
1. Judging Apache
First execute the command to find the httpd path
PS aux | grep httpd
If the httpd path is/USR/LOCAL/APACHE/BIN/HTTPD
Then execute the following command
/usr/local/apache/bin/httpd-v | grep "Server_config_file"
To find the configuration file path that was loaded at compile time httpd.conf
The-v parameter can see the parameters that are 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

Then execute the following command
/usr/local/nginx/sbin/nginx-v
By default in the installation directory conf/nginx.conf
3. Judging MySQL
First execute the command to find the MySQL path
PS aux | grep mysqld
If 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 PHP load profile path
(1), can be viewed through PHP function phpinfo, write a file, and then use the URL to access, find "Loaded configuration file" corresponding to the value of the PHP loaded configuration files
(2), if it is a 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
Then execute the following command
/usr/local/nginx/sbin/php-fpm-i | grep "Loaded Configuration File"
You can see the PHP loaded configuration file
(3), if it is a 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 a simple way to search through find.
Such as
Find/-name nginx.conf
Find/-name php.ini
Find/-name MY.CNF
Find/-name httpd.conf

This is going to be done by brush.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.