What are the features of Apache?
Functional features of Apache
1. Highly modular (Recommended learning: Getting Started with Apache )
Apache supports more functions in the form of modularization. The addition and deletion of different functions can be completed by loading and unloading modules. Similar to the modularization of the Linux kernel, the kernel driver can be loaded and unloaded. module. Constitutes the core modules model;
2. Supports dynamic loading and unloading of modules
is a function similar to hot-swapping, which can realize the service without restarting Situation loads and unloads modules and makes them available.
3. Support multi-channel processing module MPM
Apache can have three (processing) working modes, which are:
prefork- --Multi-process I/O model, one process handles one request, is the default working mode of Apache
In this working mode, there is a main process and multiple sub-processes, and those sub-processes are generated and recycled by the main process. The main process is responsible for generating sockets and managing sub-processes, but is not responsible for processing requests. The main process is executed as root;
The sub-process is the real role responsible for processing requests. There will be multiple idle sub-processes at the beginning. A process waits to handle a request, and a child process handles a request. The child process is executed by the apache user.
worker----Reuse multi-process I/O model
In this working mode, there is a main process, and the main process is also responsible for managing sub-processes Process does not process requests. The main process generates multiple sub-processes, and each sub-process generates multiple threads. One thread handles one request. In this way, assuming that the number of sub-processes is M and the number of threads of each sub-process is N, this working mode M*N requests can be processed concurrently. This mode takes up less memory and is mostly used for large websites.
event-----Event-driven model
event works similarly to worker, both handle M*N requests concurrently. But the improvement made by event is that the threads in each sub-process are divided in more detail, including management threads and service threads. Why is it designed like this?
We know that the HTTP1.1 version defaults to persistent connection keepalive. If a connection is established but no request is sent, the bandwidth of this connection will be occupied until the specified time and will not be released. Therefore, a management process has been added to specifically monitor the keepalive. Type of service thread, when a real request occurs, the management thread transfers the request to the service thread for processing. After the processing is completed, the management thread will release the resources of the service thread. Increased bandwidth utilization.
4. Virtual host
The number of visits to some websites is pitifully low. If a dedicated server is used to build such a low number of visits, it is really not worth it. Therefore, I came up with the idea of building multiple websites on one server. Multiple websites share one server to reduce resource consumption. This function is called the virtual host function.
A server builds multiple websites, each website corresponds to a different domain name. When an external client wants to access, DNS will resolve the domain names of these different websites to the same server, and the server will resolve the domain names of these different websites to the same server according to the header of the HTTP request. The domain name information in the row will forward the request to the corresponding directory resource.
Tips: The difference between a virtual host and a virtual machine->A virtual host is a function of deploying multiple websites on one host. The hosts that support so many websites run the same operating system; A virtual machine is a system that virtualizes multiple hosts through VMware, LVM and other technologies. These virtual hosts can run different operating systems.
5.CGI universal gateway interface
supports dynamic web pages. It will be very obscure to say this. Let’s first talk about what a gateway is. A gateway is the interface through which hosts in two network segments communicate. Hosts in the same network segment do not need to go through the gateway when communicating. However, once hosts in different network segments communicate, To communicate, the data needs to be handed over to the gateway first, and then the gateway can transfer it to another network segment.
Similarly, looking at CGI, the web server can only send static pages. When the server receives a file request such as index.php, the server cannot send index.php.
Because this is a dynamic file, CGI will process index.php into a prescribed data format at this time, and then hand it over to the PHP interpreter for execution, and then the executed data will be processed by CGI, and finally The results are sent from the server to the client. The CGI here serves as the conversion interface between static requests and dynamic requests.
6. Support reverse proxy
7. Can achieve load balancing
8. Support path aliases
In order to prevent users from knowing the real directory of server resources, you can make an alias for the directory. Users only need to know the alias, and the alias will automatically jump to the real directory.
9. Security authentication mechanism can be implemented
The above is the detailed content of What are the features of Apache?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Running the H5 project requires the following steps: installing necessary tools such as web server, Node.js, development tools, etc. Build a development environment, create project folders, initialize projects, and write code. Start the development server and run the command using the command line. Preview the project in your browser and enter the development server URL. Publish projects, optimize code, deploy projects, and set up web server configuration.

There are two ways to export XML to PDF: using XSLT and using XML data binding libraries. XSLT: Create an XSLT stylesheet, specify the PDF format to convert XML data using the XSLT processor. XML Data binding library: Import XML Data binding library Create PDF Document object loading XML data export PDF files. Which method is better for PDF files depends on the requirements. XSLT provides flexibility, while the data binding library is simple to implement; for simple conversions, the data binding library is better, and for complex conversions, XSLT is more suitable.

Apache errors can be diagnosed and resolved by viewing log files. 1) View the error.log file, 2) Use the grep command to filter errors in specific domain names, 3) Clean the log files regularly and optimize the configuration, 4) Use monitoring tools to monitor and alert in real time. Through these steps, Apache errors can be effectively diagnosed and resolved.

There are the following ways to generate a pom.xml file: Use Maven Archetype to provide predefined project templates to automatically generate pom.xml files for specific types of projects. Use the Maven Helper plugin to provide commands to generate pom.xml files. Create manually to customize the pom.xml file for the project.

To set character encoding on the server side to solve the garbled Bootstrap Table, you need to follow the following steps: check the server character encoding; edit the server configuration file; set the character encoding to UTF-8; save and restart the server; verify the encoding.

There are many reasons why XAMPP fails to start MySQL, including port conflicts, configuration file errors, insufficient system permissions, service dependency issues, and installation issues. The troubleshooting steps are as follows: 1) Check port conflicts; 2) Check configuration files; 3) Check system permissions; 4) Check service dependencies; 5) Reinstall MySQL. Follow these steps and you can find and resolve issues that cause MySQL startup to fail.

The preview methods of Bootstrap pages are: open the HTML file directly in the browser; automatically refresh the browser using the Live Server plug-in; and build a local server to simulate an online environment.

The key to PHPMyAdmin security defense strategy is: 1. Use the latest version of PHPMyAdmin and regularly update PHP and MySQL; 2. Strictly control access rights, use .htaccess or web server access control; 3. Enable strong password and two-factor authentication; 4. Back up the database regularly; 5. Carefully check the configuration files to avoid exposing sensitive information; 6. Use Web Application Firewall (WAF); 7. Carry out security audits. These measures can effectively reduce the security risks caused by PHPMyAdmin due to improper configuration, over-old version or environmental security risks, and ensure the security of the database.
