Introduction to the organizational structure of the NGINX+PHP-FPM configuration file _php Foundation

Source: Internet
Author: User
Tags fpm
1.nginx configuration file path


generally, when installing Nginx, the default path for the configuration file is/usr/local/nginx/conf/nginx.conf.


We can use a link file to point the Conf directory to a specific directory for easy management. For example, the author's company prefers to centralize all server configuration files in/home/server_config, then create a new subdirectory in the directory Nginx, and then point/usr/local/nginx/conf through the linked file to/home/server _config/nginx.





2.Virtual Host configuration file path
Usually, the author's company will write each virtualhost configuration file as a separate file. These independent files are independent of the different projects.





But there is a trick that we can build a subdirectory include in the directory where nginx.conf is located, in the Include directory, a series of linked files that point to the VirtualHost configuration file.





3.php-fpm configuration file path


Typically, the php-fpm execution file is in the Sbin directory under the PHP installation path. (Here, there is a digression, installation of PHP, the installation directory generally defaults to/usr/local, this is not a good choice, because sometimes, a server may need to have multiple versions of PHP.) A good implementation is to have different versions of PHP installed in/usr/local/php-xxx/, XXX on behalf of PHP version.


and PHP-FPM configuration files are placed by default in the ETC directory under the PHP installation path. In fact, the PHP-FPM configuration file can specify a path when the PHP-FPM is started, and different php-fpm instances can specify different configuration files. And this also has practical significance: on a server nginx may simultaneously monitor multiple virtualhost, when restarting a host, just restart the corresponding PHP-FPM instance.





4. configuration file path for each pool
can be specified by itself. But generally, we will manage it centrally. The author of the company chose to put it under the/var/run, and for each instance to build a folder, in addition to putting PHP-FPM in the folder, but also put the corresponding PID file, and the corresponding Unix:socket file.


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.