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!

Apachebecamefamousduetoitsopen-sourcenature,modulardesign,andstrongcommunitysupport.1)Itsopen-sourcemodelandpermissiveApacheLicenseencouragedwidespreadadoption.2)Themodulararchitectureallowedforextensivecustomizationandadaptability.3)Avibrantcommunit

Apache's performance and flexibility make it stand out in a web server. 1) Performance advantages are reflected in efficient processing and scalability, which are implemented through multi-process and multi-threaded models. 2) Flexibility stems from the flexibility of modular design and configuration, allowing modules to be loaded and server behavior adjusted according to requirements.

When the Apache 80 port is occupied, the solution is as follows: find out the process that occupies the port and close it. Check the firewall settings to make sure Apache is not blocked. If the above method does not work, please reconfigure Apache to use a different port. Restart the Apache service.

Apache cannot start because the following reasons may be: Configuration file syntax error. Conflict with other application ports. Permissions issue. Out of memory. Process deadlock. Daemon failure. SELinux permissions issues. Firewall problem. Software conflict.

To set up a CGI directory in Apache, you need to perform the following steps: Create a CGI directory such as "cgi-bin", and grant Apache write permissions. Add the "ScriptAlias" directive block in the Apache configuration file to map the CGI directory to the "/cgi-bin" URL. Restart Apache.

There are 3 ways to view the version on the Apache server: via the command line (apachectl -v or apache2ctl -v), check the server status page (http://<server IP or domain name>/server-status), or view the Apache configuration file (ServerVersion: Apache/<version number>).

To restart the Apache server, follow these steps: Linux/macOS: Run sudo systemctl restart apache2. Windows: Run net stop Apache2.4 and then net start Apache2.4. Run netstat -a | findstr 80 to check the server status.

To delete an extra ServerName directive from Apache, you can take the following steps: Identify and delete the extra ServerName directive. Restart Apache to make the changes take effect. Check the configuration file to verify changes. Test the server to make sure the problem is resolved.


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

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver CS6
Visual web development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.