Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The difference between Web server and application server and HTTP server

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge about "the difference between Web server and application server and HTTP server". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

IIS, Apache, Tomcat, Weblogic, WebSphere all belong to what kind of server, these questions have been confused for a long time, today finally sorted out clearly:

The basic function of Web server is to provide Web information browsing service. It only needs to support HTTP protocol, HTML document format and URL. Works with the client's web browser. Because the main protocol supported by Web servers is HTTP, HTTP servers and Web servers are usually equivalent (there are no web servers that support protocols other than HTTP, and the author has not verified it).

Application server (application server for short), let's first look at Microsoft's definition of it: "We define application server as" the underlying system software that executes shared business applications as a server." Just as a file server serves files to many users, an application server enables multiple users to use applications (usually customer-created applications) simultaneously."

In layman's terms, Web servers serve pages that browsers can browse, whereas application servers provide methods that client applications can call. To be precise, you could say that Web servers specialize in HTTP requests, but application servers serve business logic for applications over a number of protocols.

Taking Java EE as an example, Web servers mainly handle static page processing and as Servlet containers, interpret and execute servlets/JSP, while application servers run business logic, mainly J2EE API aspects such as EJB, JNDI and JMX API, and also include transaction processing, database connection and other functions, so in enterprise-level applications, application servers provide more powerful functions than Web servers.

With this definition, IIS, Apache, Tomcat can all belong to the Web server, Weblogic, WebSphere can all belong to the application server.

Apache: Among Web servers, Apache is a pure Web server, often paired with Tomcat. It has a strong ability to interpret HTML pages, but it cannot interpret server-side script code (JSP/Servlet) embedded in the page.

Tomcat: Early Tomcat was a JSP/Servlet interpretation engine embedded within Apache Apache+Tomcat was the equivalent of IIS+ASP. Later Tomcat is no longer embedded within Apache, and the Tomcat process runs independently of the Apache process. Moreover, Tomcat is already a separate Servlet and JSP container, and the business logic layer code and interface interaction layer code can be separated. For this reason, Tomcat has been called a lightweight application server.

IIS: Microsoft's early version of IIS was a pure Web server. Later, it embedded ASP engine, can interpret VBScript and JScript server-side code, at this time, it can double as an application server. Of course, it's nothing compared to a J2EE application server, but functionally, and in principle, it's barely an application server. Rather, it is a Web server that doubles as a bit of an application server.

Apache is a pure web server, while Tomcat and IIS can be called lightweight application servers or Web servers with server functionality because of their ability to interpret and execute server-side code. Weblogic, WebSphere because they can provide powerful J2EE capabilities, there is no doubt that they are absolute application servers. For Tomcat in the middle, it can be used with Apache, a pure Web server, or deployed with an application server as an adjunct to it:

Tomcat and Application Server

Until now, Tomcat has been known as an executor of the Servlet/JSP API, also known as a Servlet Container. Tomcat, however, does more than that; it also provides implementation mechanisms for JNDI and JMX APIs. Nevertheless, Tomcat is not an application server because it does not support most J2EE APIs.

Interestingly, many current application servers typically use Tomcat as a container for their Servlet and JSP APIs. Because Tomcat allows developers to embed Tomcat into their applications by simply adding a line of thanks. Unfortunately, many commercial application servers do not follow this rule.

Tomcat is an excellent solution for developers looking to build Java Web applications using Servlet, JSP, JNDI, and JMX technologies; but for those looking to support other J2EE APIs, it is a good solution to find an application server or use Tomcat as an adjunct to an application server; the third way is to find stand-alone J2EE API implementations and use them in conjunction with Tomcat. Although integration brings associated problems, it is the most effective way.

Tomcat and Web Server

Tomcat is a container that provides support for Servlet and JSP operations. Servlets and JSPs can generate dynamic web content based on real-time needs. For Web servers, Apache only supports static Web pages and is powerless to support dynamic Web pages;Tomcat can serve both dynamic Web pages and static Web pages. Although it is not as fast or feature-rich as the usual Web server, Tomcat has gradually expanded to support static content. Most Web servers are written in low-level languages such as C and take advantage of the characteristics of the platform, so Tomcat written in pure Java is unlikely to perform as fast as them.

In general, large sites combine Tomcat with Apache, which accepts all HTTP requests from clients and forwards Servlets and JSP requests to Tomcat for processing. When Tomcat finishes processing, it sends the response back to Apache, which returns the response to the client. And to improve performance, one apache can be connected to multiple tomcat to achieve load balancing.

Let's talk about it in detail:

Web Server

Web servers can handle the HTTP protocol. When a Web server receives an HTTP request, it returns an HTTP response, such as an HTML page. In order to process a request, the Web server may respond to a static page or image, perform a page redirect, or delegate the generation of a dynamic response to some other program such as CGI scripts, JSP(Java Server Pages) scripts, servlets, ASP(Active Server Pages) scripts, server-side JavaScript, or some other server-side technology. Regardless of their purpose, these server-side programs usually produce an HTML response that browsers can view.

Remember that the delegation model of a Web server is very simple. When a request is sent to a Web server, it simply passes the request to a program that handles the request well. A Web server simply provides an environment in which server-side programs can execute and responses can be returned, without going beyond the scope of its functions. Server-side programs usually have transaction processing, database connectivity, and messaging capabilities.

Although the Web server does not support transaction processing or database connection pooling, it can deploy various strategies to achieve fault tolerance and scalability, such as load balancing, caching. Clustering-features are often mistaken for application server-specific features only.

The Application Server

By our definition, as an application server, it exposes business logic to client applications via various protocols, including HTTP. Web servers are primarily concerned with sending HTML to browsers for browsing, while application servers provide access to business logic for client applications to use. Applications use this business logic just as if you were calling a method of an object (or a function in a procedural language).

The client side of the application server (which includes a graphical user interface (GUI)) may be running on a PC, a Web server, or even another application server. Information traveling back and forth between an application server and its clients is not limited to simple display tags. Instead, this information is program logic. It is because this logic takes the form of data and method calls rather than static HTML that clients can use this exposed business logic at will.

In most cases, application servers expose business logic (to client applications) through application program interfaces (APIs) of components, such as EJB(Enterprise JavaBean) component models based on J2EE(Java 2 Platform, Enterprise Edition) application servers. In addition, application servers can manage their own resources, such as gate-keeping duties including security, transaction processing, resource pooling, and messaging. Just like Web servers, application servers are configured with a variety of scalability and fault tolerance technologies.

Warning (Caveats)

XML Web Services have now blurred the lines between application servers and Web servers. By sending an XML payload to the server, Web servers can now process data and responses as much as application servers used to.

In addition, most application servers now include Web servers, which means that Web servers can be considered a subset of application servers. Although application servers incorporate Web server capabilities, developers rarely deploy application servers to this capacity. Instead, they often configure Web servers separately from application servers, if needed. This separation of functions helps improve performance (simple Web requests don't affect application servers), separate configurations (dedicated Web servers, clustering, etc.), and leaves room for product selection.

"Web server and application server and HTTP server difference" content introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report