Organization structure of the nginx + php-fpm configuration file _ PHP Tutorial

Source: Internet
Author: User
The organizational structure of the nginx + php-fpm configuration file. 1. nginx configuration file path. Generally, when installing nginx, the default path of the configuration file is usrlocalnginxconfnginx. conf. We can use a link file 1. nginx configuration file path
Generally, when installing nginx, the default path of the configuration file is/usr/local/nginx/conf/nginx. conf.
We can use a link file to direct the conf directory to a specific directory for convenient management. For example, my company prefers to centralize all server configuration files in/home/server_config, and then create a subdirectory nginx in this directory, then point/usr/local/nginx/conf to/home/server_config/nginx through the link file.

2. path of the Virtual host configuration file
Generally, my company writes the configuration file of each Virtualhost into an independent file. These independent files are independent in different projects.

But there is a trick, we can go to nginx. in the directory where the conf file is located, create a subdirectory include. in the include Directory, there are a series of linked files pointing to the Virtualhost configuration file.

3. php-fpm configuration file path
Generally, the php-fpm execution file is in the sbin directory under the php installation path. (In this case, when installing php, the installation directory is usually/usr/local by default. this is not a good choice, because sometimes, multiple php versions may be required on one server. A good implementation is to install different versions of php in/usr/local/php-xxx/respectively, and xxx represents the php version ).
The configuration file of php-fpm is stored in The etc directory under the php installation path by default. But in fact, the php-fpm configuration file can specify the path when starting php-fpm. different php-fpm instances can specify different configuration files. This is also practical: Nginx on a server may listen to multiple virtualhosts at the same time. when restarting a Host, you only need to restart the corresponding php-fpm instance.

4. path of the configuration file for each pool
You can specify it as needed. But generally, we manage them in a centralized manner. My company chose to put it under/var/run and create a folder for each instance. in addition to php-fpm, the folder also contains the corresponding pid file, and the corresponding unix: socket file.

Generally, when installing nginx, the default path of the configuration file is/usr/local/nginx/conf/nginx. conf. We can use a link file to set the conf object...

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.