The difference between Apache and Tomcat

Preface

Making making making making someone once asked me, the difference between Apache and Tomcat, actually I also thought about this issue, but did not think, just think they are different is that can perform different script language. Once installed Apache is used to interpret the PHP so I never think he said Apache is used to explain the PHP and Tomcat is used to explain the JSP. Today suddenly have this question, finally want to understand this problem, so the Internet to find out about the problem, find it really is a problem, there are many about the problem of content on the web. So the web content summary, by adding a little of his own understanding, for a record.

Overview

Making making making first start from a Web application, Web application include things not just shopping cart, exit pages and those who attract sb.'s attention graphics, the electronic commerce application most used 3 layer structure. So when talking about the "application", we actually refers to one or more servers. This is copied on the application of Web a paragraph in a book, I think these words with a lot of problems. Again the following excerpt him about the composition of Web application "with one or more server" classification, divided into the following three categories.

 

Web server: this part provides a web page for users to browse the web browser. The most common example is the Apache and IIS.

 

Application server: this part for the user operation, interpretation, providing data. The application server can be part of a web server, such as PHP and Apache, or ASP.NET is. On the other hand, the application server can be physically separate servers, such as Tomcat servlet engine.

 

Database: all data required for this part of storage applications. Although the user with Web and application server interaction, but they usually cannot access the database server. In most cases, between the application server and database user data, and formatted data to the correct storage.

 

Making making making according to my understanding of the above, Apache is a Web server, Tomcat application server. The difference between the Web server and application server where, according to my understanding is that they concentrate in different directions, the Web server to focus on and customer interaction, communication. The HTML page to the user. Some of the processing and the application server is focus on the processing on the server, such as converting JSP to servlet, then the server according to the request in the Java class file dynamically generated HTML generation and the page is returned to the user. The following is from the Internet to find the difference.

 

Different

 

1, APACHE is a WEB server, Web server (serves) page so that the browser can browse, Web server dedicated to processing the HTTP request (request), but the application server is through a lot of agreement to provide for the application business logic (serves)(business logic).
TOMCAT is an application server running on APACHE, the application server is provided by the client application can call (call) method (Methods). It is only a servlet (JSP of servlet) container, can be considered as the extension of Apache, but can be run independently of Apache.

2, Apache is a common server, itself only support HTML that ordinary Webpage. But can support the PHP via plug-ins, can also communicates with the Tomcat Apache Tomcat (one-way connection, that is through the Apache can access Tomcat resources. But not vice versa),

Tomcat is a jsp/servlet container, but also support HTML, and CGI. CGI requires some manual debugging, but easily.

3, Apache: focus on the HTTP server, but the tomcat: focus on the servlet engine, if running in standalone mode, the function and the Apache equivalent, support JSP, but on the static Webpage not ideal.

4, Apache can run a year without restart, stability is very good, but Tomcat is not necessarily.

5, Preferred web server is Apache, but Apache can not explain JSP, servlet with Tomcat.

6, Apache is the page analysis service is started, Tomcat is the development of the , In essence, The function of Tomcat can replace Apache, But after all Apache is Tomcat senior level figure, And the market has a lot of people still use Apache, So Apache will continue to exist, Never be replaced, Apache Java cannot be resolved, But HTML parsing speed.


Example

Apache is a car, it can hold something such as HTML etc.. But cannot hold water, with water must have a container (barrel), and the barrel can not put in the truck. The barrel is TOMCAT.

 

I want to give a example

 

Apache is a company, the company to provide services to customers, while Tomcat is a technical personnel of this company, the employees work in the company to provide customers with services. The employee can serve for the company, the company and the customers, though he can no longer own mixed up in the company. Then he would himself and clients. Can also provide services to the user. This is my understanding of the difference of Apache and Tomcat.

 

Web beginner, mistakes can hardly be avoided, welcome to know your generous with your criticism. In the next three.

 

Reference resources

 

Posted by Joy at December 21, 2013 - 11:11 PM