Lao Zuo believes that many friends will be confused about Nginx, Apache, Tomcat, including LNMP, LAMP, and even LANMP when choosing web engine services. When we use the commonly used virtual host, we usually use the Apache environment. For example, we use the cPanel panel to manage the virtual host. The pseudo static is the HTACCESS file.
However, at present, cloud servers have become popular, and many of our businesses have begun to transform from virtual hosts to cloud servers. Some netizens are also like this. Virtual hosts have not yet fully understood, and they have begun to follow the trend of using cloud servers. So when deploying the WEB environment in a Linux faceless environment, I feel dizzy. In this article, Lao Zuo helps you choose the Web engine based on the problems encountered when personal webmasters choose it. If we go to query relevant documents, we will directly confuse you.
We see three common Web environments: Nginx, Apache, and Tomcat, which are all used to process HTTP website web environments. The first two are mostly used to process PHP, while Tomcat is used to process JAVA, which is also known as JSP language. At present, most netizens or CMS users use more PHP+MYSQL, so they use the first two more.
First, features of Nginx engine
We can see some one click package WEB environments, or see the pagoda panel. When installing WEB, we will see LNMP. This N actually means Nginx engine. Nginx is characterized by high concurrency, low memory consumption and low cost.
According to the official test mentioned, Nginx can support more than 50000 concurrent connections, and can support 20000 to 40000 concurrent connections in actual production. The memory occupation is small. If we can have a chance to see who occupies the small memory when you install Apache and Nginx in the server, I can see that Apache is slightly higher. Similarly, the problem brought by this is that Nginx needs lower costs.
Slightly different from Apache, the pseudo static mode is different. Some of our friends are used to directly Apache in the root directory. htaccess pseudo static file, while Nginx requires a separate. conf configuration, which is slightly different.
Second, the features of the Apache engine
Seeing the advantages of Nginx mentioned above, is it better than Apache? Of course, it is not necessarily relative. For example, Apache 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 more modules and basically covers all applications. After all, people used it more widely than Nginx in their early days. Apache's support for PHP is relatively simple, and Nginx needs to cooperate with other back ends.
Apache is a synchronous multi process model, one connection corresponds to one process; Nginx is asynchronous, and multiple connections (ten thousand level) can correspond to one process.
Third, Tomcat engine features
As we mentioned above, Tomcat generally 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 seen as an extension of Apache and can run independently of Apache. Tomcat focuses on the servlet engine. If it runs 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 that Tomcat is an extension of the Apache server, so when we run tomcat, it actually runs as an independent Apache process. Apache serves HTML pages, while Tomcat actually runs JSP pages and servlets. Tomcat, like IIS, Apache and other Web servers, has the ability to process HTML pages, but Tomcat's ability to process static HTML is not as good as that of Apache servers.
To sum up, Lao Zuo personally believes that if you are building a website using ECS WEB, PHP+MYSQL, it is recommended to use the LNMP environment, that is, NGINX. Of course, this also depends on the actual compatibility support. Some programs must use APACHE.
Scan the code to follow the official account
Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge