Differences between Apache and Tomcat and Web server, container, and application server issues

Source: Internet
Author: User
Tags server port

The issue of the difference between Apache and Tomcat was discovered when the bookmark was cleared. Plan to start learning the servlet when the problem solved together, just beginning to learn the Java EE, the first learning is servlet, running need Tomcat, at that time I am very depressed what this is, what web container, really do not understand, back to ask a friend, A friend said it would be nice to think of it as a server for the time being.


The following questions 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 servers, then we often hear nginx such a server, and the difference between Apache?

1. What is a server When you look at the Apache definition, you will find that Apache is the Web server, which is the Web servers.

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

2.differences between Web servers, Web containers, and application servers Web server,web container and application Server differ.

Web Server,web Server, as stated above, A Web server is a program that provides documentation for the browser that makes the request. A server is a passive program that responds only when the browser makes a request. The application layer is using the HTTP protocol. currently the most mainstream three Web servers are Apache Nginx IIS.

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

As with Tomcat, the servlet is parsed after receiving a request from the browser, and then the results of the servlet processing are returned to the browser. In fact, Tomcat is both a Web server and a Web container. Why do you say so, 3rd?

and the application server, here's a separate answer to the Web server:
What is the difference between application server and Web server?
Web server design serves HTTP content, and application servers are not limited to HTTP. Web servers serve static content, and plug-ins support dynamic languages,
The application server also has these things for the Web server, in addition to this it also supports program-level services such as connection pooling, transaction support, information services, and so on.

As for Tomcat is not the application server, it is not good to say.


3. The difference between Apache and TomcatApache refers to Apache HTTP Server.
StackOverflow The problem is closed, but there is a comment on the blog is very good.
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 is also used as a Web server.

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

As you can see from here, In fact, Tomcat is both a Web server and a Web container.

In the case of a servlet class, the servlet engine simply loads the servlet class and executes it, then outputs it in HTML format and returns it to the browser.

and Apache is a Web server designed to serve static web pages. if it is Apache to receive JSP requests, it does not know what this is, so the return is not the result we want, but the static page, such as http://www.apache.com/ Index.html such a request, Apache will directly return this page to the requesting browser.


4, are servers, then we often hear nginx such a server, and the difference between Apache Nginx is the abbreviation of Engine X, unlike Apache, Nginx is a high-performance HTTP and reverse proxy server.
In fact, this piece of me is very little contact,
But before I saw someone else's blog hanging out of this nginx, has been very curious about what this is,
There is a brother with Raspberry Pi plus nginx plus PHP sent a helloworld, also let me feel very magical.


This comparative theory is used when practicing English and understanding basic theoretical knowledge.


Differences between Apache and Tomcat and Web server, container, and application server issues

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.