Last update at :2024-06-26,Edit by888u
Snail believes that many friends will be confused by the combination of Nginx, Apache, Tomcat, including LNMP, LAMP, and even LANMP when choosing WEB engine services. When we commonly use virtual hosts, we generally use the Apache environment. For example, the virtual hosts we use cPanel panel management, pseudo-static uses HTACCESS files.
However, cloud servers have become popular now, and many of our businesses have begun to transition from virtual hosts to cloud servers. Some netizens are like this too. They don’t understand virtual hosts very well, and they have begun to follow the trend and use cloud servers. . So I got dizzy when deploying the WEB environment in a Linux panel-less environment. In this article, Snail helps you choose based on the problems that individual webmasters encounter when choosing a WEB engine. If we query the relevant documents, we will directly confuse you.
The three common WEB environments we see are Nginx, Apache, and Tomcat, all of which are used to process HTTP website web environments. The first two are mostly used to process PHP, and Tomcat is used to process JAVA. It is the JSP language we often talk about. At present, most netizens or CMS use PHP+MYSQL more, so the former two are used more.
First, the characteristics of Nginx engine
We have seen some one-click package WEB environments, or when installing WEB in the pagoda panel, you will see LNMP. This N actually means Nginx engine. Nginx has the characteristics of high concurrency, low memory consumption, and low cost.
According to official tests, Nginx can support more than 50,000 concurrent connections, and can support 20,000-40,000 concurrent connections in actual production. The memory footprint is small. If we have the opportunity to take a look, when you install Apache and Nginx on the server, compare which one occupies less memory. I can see that Apache is slightly higher. Likewise, the problem this brings is that Nginx needs to be cheaper.
Slightly different from Apache in that the pseudo-static method is different. Some of our friends are used to directly Apache .htaccess pseudo-static files in the root directory, while Nginx requires a separate .conf configuration, which is slightly different.
Second, characteristics of the Apache engine
Seeing the various advantages of Nginx mentioned above, is it definitely better than Apache? Of course it's not necessarily relative. For example, Apache also has many user groups, and even personal websites like to use this WEB environment. Apache's pseudo-static rewrite is more powerful and convenient than nginx. It supports many modules and basically covers all applications. After all, it was more widely used than Nginx in the early days. Apache's support for PHP is relatively simple, and Nginx needs to cooperate with other backends.
Apache is a synchronous multi-process model, and one connection corresponds to one process; nginx is asynchronous, and multiple connections (10,000 levels) can correspond to one process.
Third, Tomcat engine features
As we mentioned above, generally Tomcat handles JAVA, which is what we call the JSP language WEB environment. Tomcat is an application (Java) server and a Servlet container. It can be regarded as an extension of Apache and can run independently of Apache. Tomcat focuses more on the Servlet engine. If run in standalone mode, it is functionally equivalent to Apache and supports JSP, but it is not ideal for static web pages.
In fact, we can also understand it this way. The Tomcat part is an extension of the Apache server, so when we run tomcat, it actually runs independently as an independent process of Apache. Apache serves HTML pages, while Tomcat actually runs JSP pages and Servlets. Tomcat, like IIS, Apache and other web servers, has the function of processing HTML pages, but Tomcat's ability to process static HTML is not as good as the Apache server.
To summarize, Snail personally believes that if you use cloud server WEB to build a website, PHP+MYSQL, it is recommended to use the LNMP environment, which is NGINX. Of course, this also depends on the actual compatibility support, and some programs must Use APACHE.
Recommended site searches: website icp filing, ip168, server space rental, Taiwan server rental, server rental, Yangzhou dual-line server multi-IP station group server, high-defense server rental, high-defense server rental, ip online agent
发表评论