For many students who are familiar with VPS, the first thing to do after opening the VPS is to set up a server environment. To save trouble and convenience, there are popular one-click installation packages available online. At present, there are generally two popular ones: LNMP and LNAMP.
LNMP is a combination of Linux+Nginx+Mysql+PHP. It is characterized by using the speed and lightweight of Nginx to replace the previous LAMP (Linux+Apache+Mysql+PHP) method. Because installation is easy and the installation script is updated at any time, LNMP has become the one-click installation package preferred by many webmasters.
Advantages of the LNMP method: it takes up less VPS resources, and Nginx is relatively simple to configure. It uses fast-cgi to dynamically parse PHP scripts.
Disadvantages of the LNMP method: The load capacity of the php-fpm component is limited. When the number of visits is huge, the php-fpm process is prone to zombies and 502 bad gateway errors are prone to occur.
LNAMP is a combination of Linux+Nginx+Apache+Mysql+PHP. Its characteristic is that it uses Nginx to parse static scripts, and uses the forwarding feature of Nginx to transfer the parsing of dynamic scripts to Apache for processing. , In this way, the characteristics of the two web servers can be fully utilized, which is a very good choice for sites with large traffic demand.
Advantages of the LNAMP method: Since Apache itself has a stronger ability to process PHP than php-fpm, errors like 502 bad gateway are less likely to occur. Suitable for sites with high traffic volume.
Disadvantages of the LNAMP method: Compared with the LNMP method, it takes up more resources. In addition, configuring the virtual host requires modifying the configuration files of Nginx and Apache at the same time, which is a little more troublesome.
The above is the detailed content of Compare the differences between LNMP and LNAMP. For more information, please follow other related articles on the PHP Chinese website!