Web server Apache and Tomcat difference between father and son

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Making often used in Apache and Tomcat these servers, you always feel not clear what the relationship between them. In the Tomcat when the total Apache, total feel confused, who is the Lord who is the first? This article will give you a detailed answer.

Making making familiar with three friends all know Cao Cao, Cao Cao had twenty-five sons, one of the most well loved Cao Pi, Cao Cao is Cao Zhi, Cao Zhang three, Cao Pi was good at politics; Cao Zhi personality, full of wit, bohemian; Cao Chang Wu Yi strength, outstanding military exploits. Cao Cao had hoped the three sons from his successor, finally and Cao Cao character most similar Cao Pi talent showing itself. But we can never deny the genius of Cao Zhi and Cao Zhang's martial arts.

Apache is the world's first use Web server software. It can run on almost all the widely used computer platform, because of its cross platform and security is widely used, is one of the most popular Web server software. At the Apache foundation in Apache Server will always be given the greatest support, after all, the most dear son, and open source Apache server software Tomcat the same concern, after all, Tomcat is a free open source products, users will give maximum support. But often in the use of Apache and Tomcat these servers, you always feel not clear what is the connection between them, in the use of Tomcat when the total Apache, total feel confused, who is the Lord who is the time, therefore specially in the Internet for some information, summed up the. (51CTO editors: Tomcat 7 function and Application Guide)

Analysis of a:

Apache supports a static page, Tomcat supports dynamic, such as Servlet etc.,

General use Apache+Tomcat, Apache just as a forward, the processing of JSP is handled by Tomcat.

Apche can support PHPcgiperl, but want to use Java, you need to Tomcat in the Apache support, the Java requests forwarded by Apache to the Tomcat process.

Apache is a Web server, Tomcat application server (Java), it is only a Servlet (JSP of Servlet) container, can be considered as the extension of Apache, but can be run independently of Apache.

These two have can compare the following points:

◆Both Apache development organizations

◆Both have the function of HTTP service

◆Both are free

Different point:

Apache is devoted to provide HTTP services, as well as the related configuration (e.g., virtual host, URL forwarding etc.)

Tomcat is a JSP server Apache organization development in line with the Java EE JSP, Servlet standard.

  1. Runtime r=Runtime.getRuntime();   
  2. Process p=null;   
  3. try   
  4. {   
  5. p=r.exec("notepad");   
  6. }   
  7. catch(Exception ex)   
  8. {   
  9. System.out.println("fffff");   
  10. }   
  11.  

Analysis of two:

Apache is a Web server program, enabling him to can be used as a Web server, but only support static Webpage (such as ASP, PHP, CGI, JSP) and the dynamic Webpage.

If you want to run the JSP in the Apache environment, you'll need an interpreter to execute the JSP Webpage, while the JSP interpreter is Tomcat, why JDK? Because JSP needs to connect to the database will be JDK to provide connections to the database driver, so to Web server running JSP requires Apache+Tomcat+JDK.

Integrated benefit:

◆If the client request is static page, it only needs Apache server in response to a request.

◆If the client requests for dynamic pages, is the Tomcat server in response to a request.

◆Because the JSP server is interpreted code, such integration can reduce the Tomcat service cost.

C is a structured language, such as Tan Master said: it focuses on the algorithms and data structures. C program design of first consideration is how to through a process, the input (or environment) are the output (or process (transaction) control), and for C++, the primary consideration is how to construct an object model, so the model can fit the problem domain and the corresponding, so we can get the object's state information is outputted or process control (Affairs).

Analysis of three:

Apache: focuses on HTTP Server

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,

Apache is a Web server, Tomcat application server (Java), it is only a Servlet (JSP of Servlet) container, can be considered as the extension of Apache, but can be run independently of Apache.

In other words, Apache is a truck, 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.

Summary

In general, Tomcat might never became Apache's most important products, but who also can't stop Tomcat has become the mainstream product, Apache for this little son will also give considerable concern.

 

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Joe at February 09, 2014 - 12:36 AM