The difference between Apache and Tomcat and the difference between Web server, container and application server

1. What is a server

When looking at the definition of Apache, you will find that Apache is a Web server, that is, a Web server.

A web server is a program capable of serving documents to requesting browsers. The server is a passive program that only responds when the browser makes a request. The application layer uses the HTTP protocol.

2. The difference between web server, web container and application server

The difference between Web Server, Web Container and Application Server.

Web Server, Web server, as mentioned above, a Web server refers to a program that can provide documents to the browser that makes the request. The server is a passive program that only responds when the browser makes a request. The application layer uses the HTTP protocol. The three most popular web servers are Apache Nginx IIS.

A web container is a server program, and there is a program that provides corresponding services on the server port. So now know why Tomcat has default port - 8080. A server can have multiple containers.

For example, Tomcat will parse the servlet after receiving the request from the browser, and then return the result processed by the servlet to the browser. In fact, Tomcat is both a web server and a web container. Why this is said, the third point will be discussed.

As for the application server, here is an answer that distinguishes it from the web server:
What is the difference between application server and web server? The
web server is designed to serve HTTP content, and the application server is not limited to HTTP. The web server serves static content, there are plugins to support dynamic languages, and the
application server also has these things of the web server. In addition, it also supports program-level services, such as connection pooling, transaction support, information services, and so on.

As for whether Tomcat is an application server, it is hard to say.

3. The difference between Apache and Tomcat

Apache refers to Apache HTTP Server.
Although this question in stackoverflow has been closed, it is good to have a blog written in a comment.
What is Tomcat? Is it a Web Server? What can Tomcat do? How is it different than Apache Web Server?
It says:

Tomcat is a Servlet/Jsp container that also acts as a web server.

Tomcat = ( Web Server + Servlet container + JSP environment ), because we know that JSP is also translated into Servlet. After Tomcat receives the request, if it is a JSP page, the JSP engine in Tomcat can convert the JSP into a Servlet class.

It can also be seen from here that Tomcat is actually both a web server and a web container.

If it is a servlet class, the servlet engine directly loads the servlet class and executes it, then outputs it in HTML format, and then returns it to the browser.

Apache, on the other hand, is a web server designed to serve static web pages. If Apache receives the jsp request, it doesn't know what it is, so it doesn't return the results we want, but for static pages, such as http://www.apache.com/index.html When requested, Apache directly returns the page to the requesting browser.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326317610&siteId=291194637