PHP Bottom Depth Exploration (2)---Analysis of the operating mechanism of Apache
Source: Internet
Author: User
analysis on the operating mechanism of ApacheL
b/S Interactive processThe process of interaction between the browser and the server is shown in figure:
1. The browser (Browser) makes an HTTP request to the server (WEB server) (request). 2, the server (WEB server) Analysis browser request, output response data (Response). 3, the browser (Browser) received the response data to resolve, and finally displayed in the browser. Here is a browser's request data and the server's response data:
The above is very simple, I think the Web developers are very clear about this process, no longer repeat. L
Apache OverviewThe most widely used Web server in the world, Apache is known for its cross-platform, efficient, and stable, with the official statistics that the Apache server's installed capacity accounts for more than 60% of the market, especially on the X (Unix/linux) platform. Other Web server products, such as IIS, can only run on Windows platforms, most of which are combined with Microsoft. NET technical organization to use together. One of the things that Apache is most criticized for is that it's getting heavier, it's considered heavyweight webserver, so then there's a lot of lightweight alternatives, like Lighttpd,nginx, whose common feature is a significant increase in efficiency, but often only for certain situations. L
Apache component Logic diagramApache is based on modular design, the core code is not really many. If you want to read Apache's source code, it is recommended that you read directly from the core.c file, with the main processing logic included. Most of the Apache functionality is distributed across modules, which are loaded on demand when the system starts. MPM (multi-processing Modules, multiprocessing module) is the core component of Apache, and Apache manages the process/thread pool through MPM using the resources of the operating system. In addition, in order to get the best performance, Apache for different platforms (Unix/linux, Window) to do the optimization, providing different mpm, of which the most common prefork and two kinds of worker. The way your server is running depends on the compilation parameters specified during the installation of Apache. The default compilation on the X system is prefork mode. Because most UNIX does not support true multithreading, in a pre-derived subprocess (prefork) approach, worker is a hybrid pattern based on multiple processes. Students interested in this can read the relevant information, no longer speak here. The logical composition of Apache and its relationship to the operating system APR (Apache Portable Runtime Library), the Apache Portable runtime, is an abstract library used to implement the operating system for Apache internal components. The Apache parsing of PHP is done through the PHP module labeled in the diagram. L
the life cycle of ApacheThe content of this section will be related to the loading of the PHP module, you can have a little attention. The following graphic is used to illustrate the life cycle of Apache (prefork mode).
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.