Organization structure of the nginx + php-fpm configuration file

Source: Internet
Author: User
: This article mainly introduces the organizational structure of the nginx + php-fpm configuration file. if you are interested in the PHP Tutorial, refer to it. The organizational structure of the nginx + php-fpm configuration file is for your reference.

The organizational structure of the nginx + php-fpm configuration file is for your reference.

I. 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.

II. 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.
However, you can create a subdirectory include in the directory where nginx. conf is located. the include directory contains a series of linked files that point to the Virtualhost configuration file.

III. 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.
On a server, Nginx may listen to multiple virtualhosts at the same time. when restarting a Host, you only need to restart the corresponding php-fpm instance.

IV. path of configuration files for various pools
You can specify it as needed. But generally, we manage them in a centralized manner. I 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 unix: socket file.

The preceding section describes the organizational structure of the nginx + php-fpm configuration file, including some content. if you are interested in the PHP Tutorial.

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.