Differences between Apache and Tomcat and Web servers, containers, and application servers

Source: Internet
Author: User

Differences between Apache and Tomcat and Web servers, containers, and application servers
The difference between Apache and Tomcat was found during bookmarks clearance. I plan to solve the problem when I first started learning Servlet. When I first started learning J2EE, I first learned Servlet and needed Tomcat to run it. At that time, I was very depressed about what this was, I really don't understand What Web containers are. I asked a friend later and said that it would be nice to understand it as a server for the time being.


The following problems are:
1. What is a server?
2. What are the differences between Web servers, Web containers, and application servers?
3. What is the difference between Apache and Tomcat?
4. Are all servers, so we often hear the difference between Nginx and Apache?

1. When you view the definition of Apache on a server, you will find that Apache is a Web server, that is, a Web server.

A Web Server is a program that provides documentation for the browser that sends the request. A server is a passive program that responds only when a browser sends a request. The application layer uses the HTTP protocol.

2. Differences between Web servers, Web containers, and Application servers: Web servers, Web container, and Application Server.

Web Server, Web Server, as mentioned above, Web Server is a program that can provide documentation for the browser that sends the request. A server is a passive program that responds only when a browser sends a request. The application layer uses the HTTP protocol. Currently, the three most popular Web servers are Apache Nginx IIS.

A Web container is a server program that provides services on the server port. So now we know why Tomcat has the default port -- 8080. A server can have multiple containers.

For example, Tomcat parses the Servlet after receiving the browser request, and then returns the Servlet processing result to the browser. In fact, Tomcat is both a Web server and a Web container. Why do we say this? The third point will be discussed.

The app server has 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 and has plug-ins that support dynamic languages,
The application server also has Web servers. In addition, it also supports Program-level services, such as connection pools, transaction support, and information services.

It is hard to say whether Tomcat is an application server.


3. Differences between Apache and Tomcat Apache refers to Apache HTTP Server.
This problem in stackoverflow has been disabled, but a comment blog is quite good.
What is Tomcat? Is it a Web Server? What can Tomcat do? How is it different than Apache Web Server?
This section describes:

Tomcat is a Servlet/Jsp Container, which is also used as a web server.

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

We can also see that Tomcat is both a Web server and a Web container.

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

Apache is a web server designed to serve static web pages. If Apache is used to receive jsp requests, it does not know what this is, so the returned results are not what we want, but static pages, such as the response.


4. All servers, so we often hear servers such as Nginx. The difference between Nginx and Apache is the abbreviation of engine x. What is different from Apache is, nginx is a high-performance HTTP and reverse proxy server.
In fact, I have little contact with this,
However, when someone else's blog crashes, Nginx has always been curious about what this is,
Another senior engineer sent a Helloworld with Raspberry Pi and Nginx and PHP, which also made me feel amazing.


This comparative theory is used to practice English and understand basic theoretical knowledge.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.