In the process of learning the front end. The process heard and saw the web server, HTTP server and application server, but did not know the difference between them. It has been confused for a long time. Many blogs viewed today have finally been sorted out. Let me summarize their differences and learn about some servers in turn.
First, we need to know that the web server only needs to support HTTP protocol, HTML document format and URL. Its main function is to transmit pages so that the browser can browse. Because it mainly supports HTTP protocol, the web server and HTTP server are usually equal. Generally speaking, web server is specially used to process HTTP requests.
Application server can be referred to as application server for short. Its main function is to provide callable methods (application services business logic) for client applications.
Taking Java EE as an example, web services mainly deal with static pages and serve as servlet containers to interpret and execute servlets / JSPS, while application servers run business logic.
With this definition, some common servers can be classified. IIS, Apache and Tomcat can all belong to web servers, and Weblogic and WebSphere can all belong to application servers. Here are the main functions of these servers:
Among web servers, Apache is a pure web server, which is often paired with Tomcat. It has a strong ability to interpret HTML pages, but it can not interpret the server-side script code (JSP / servlet) embedded in the page.
Early Tomcat was a JSP / servlet interpretation engine embedded in Apache. Apache + Tomcat was equivalent to IIS + ASP (dynamic server page). Later, Tomcat is no longer embedded in Apache, and the Tomcat process runs independently of the Apache process. Moreover, Tomcat is already an independent servlet and JSP container, and the business logic layer code and interface interaction layer code can be separated. Therefore, some people call Tomcat a lightweight application server.
Microsoft’s early IIS was a pure web server. Later, it embedded the ASP engine to interpret VBScript and JScript server-side code. At this time, it can also be used as an application server. In principle, it can barely be called an application server. To be exact, it is a web server with a little application server function.
To sum up:
Apache is a pure web server, while Tomcat and IIS can be called lightweight application servers or web servers with server functions because of their ability to interpret and execute server-side code. Weblogic and WebSphere are undoubtedly absolute application servers because they can provide powerful J2EE functions. For Tomcat in the middle, it can be used with Apache, a pure web server, or deployed with the application server as an auxiliary of the application server