How to check the LNAMP configuration file path

888u

Last update at :2023-12-30,Edit by888u

Generally speaking, you generally know where the environment configuration you installed is located. Some novices initially asked the hosting provider to help install it or outsourced it directly. After taking over, they will have doubts: how to check nginx, apache, php , mysql configuration file path? In the previous article "Default installation paths of Apache, PHP, and MYSQL in Linux systems", we introduced the common default installation paths. At this time, you can use commands to operate. Log in to SSH to determine the specific path:

1.nginx
Execute the command to find the nginx path: ps aux | grep nginx
For example, the nginx path is:/usr/local/nginx/sbin/nginx

Then execute the following command:
/usr/local/nginx/sbin/nginx -V
By default, it is placed in the installation directory conf/nginx.conf

2. apache
Execute the command to find the httpd path:
ps aux | grep httpd
For example, the httpd path is: /usr/local/apache/bin/httpd
Then execute the following command:
/usr/local/apache/bin/httpd -V | grep “SERVER_CONFIG_FILE”
You can find the path to the configuration file loaded during compilation httpd.conf
The -V parameter allows you to see the parameters configured during compilation

3.mysql
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 configuration file path loaded by php
(1) You can view it through the php function phpinfo, write a file, and then access 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
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 an apache+mod_php configuration, you can also check the loaded php.ini path in the apache configuration file. Such as PHPIniDir “/usr/local/apache/conf/php.ini”

Recommended site searches: domain name space proxy, server rental, mainland China proxy IP, same IP website query, US virtual host purchase, Chinese domain name registration, cm domain name registration, free proxy IP, US virtual host purchase, how much does server defense cost? ,

How to check the LNAMP configuration file path

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码