The difference between a Web server parent and a child Apache and Tomcat

Source: Internet
Author: User
Tags url forwarding

Http://developer.51cto.com/art/201007/210894.htm

Familiar with the friends of the three countries know Cao, Cao has 25 sons, of whom Cao is the most favored is Cao Pi, Cao Zhi, Cao Shu three, Cao Pi character cold, good at politics, Cao Zhi talented, bohemian unruly, Cao Shu martial arts, exploits outstanding. Caocao has always hoped that the three sons among the choice of their heirs, the last with the most similar character Cao Cao Pi stand out. But we will never deny Cao Zhi's talent and Cao Shu's kung Fu.

Apache is the world's most used Web server software. It can run on almost all widely used computer platforms and is one of the most popular Web server-side software due to its widespread use across platforms and security. Apache Server in the Apache Foundation will always be given the greatest support, after all, the oldest son of the most pro, and Apache's Open source Server software Tomcat is also worth attention, after all, Tomcat is open source free products, users will give maximum support. But often when using Apache and Tomcat and other these servers, you always feel unclear what the relationship between them, when using Tomcat always appear Apache, always confused, who is the Lord who is the time, so deliberately on-line query Some of this information, summed up a bit. (51CTO Editor's recommendation: Tomcat 7 features and application guide)

Parsing one:

Apache supports static pages, and Tomcat supports dynamic, such as Servlets,

For general use of Apache+tomcat, Apache is just a forwarding, and the processing of JSPs is handled by Tomcat.

Apche can support Phpcgiperl, but to use Java, you need Tomcat to support the Apache backend, and the Java request will be forwarded to Tomcat for processing by Apache.

Apache is a Web server, Tomcat is an application (Java) server, it is just a servlet (JSP also translated into a servlet) container, can be considered an Apache extension, but can be run independently of Apache.

These two can be compared in the following points:

Both are developed by the Apache organization.

Both have the functionality of the HTTP service

Both are free.

Different points:

Apache is dedicated to providing HTTP services, and related configuration (such as virtual host, URL forwarding, etc.)

Tomcat is a JSP server developed by the Apache organization in the Java EE-compliant 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. }

Parsing two:

Apache is a Web server environment program that enables him to be used as a Web server, but only supports static web pages such as Dynamic Web pages (asp,php,cgi,jsp).

If you want to run JSP in the Apache environment, you need an interpreter to execute the JSP Web page, and this JSP interpreter is Tomcat, why do you want the JDK? Since the JSP needs to connect to the database, the JDK is required to provide the drive to connect to the database, so the Web server platform to run the JSP needs to be apache+tomcat+jdk.

The benefits of consolidation are:

If the client is requesting a static page, only the Apache server is required to respond to the request.

If the client requests a dynamic page, the Tomcat server responds to the request.

Because JSP is the server-side interpretation code, this consolidation reduces the service overhead of Tomcat.

C is a structured language, as Tam says: It focuses on algorithms and data structures. The design of C program is the primary consideration is how to get the output (or implementation process (transaction) control) through a process, the input (or the environment condition), and for C + +, the first consideration is how to construct an object model, so that the model can fit with the corresponding problem domain, This allows the output or implementation process (transaction) control to be obtained by acquiring the state information of the object.

Parsing three:

Apache: Focus on HTTP Server

Tomcat: Focus on the servlet engine, if run in standalone mode, functionally equivalent to Apache, support JSP, but not ideal for static web pages;

Apache is a Web server, Tomcat is an application (Java) server, it is just a servlet (JSP also translated into a servlet) container, can be considered an Apache extension, but can be run independently of Apache.

In other words, Apache is a truck that can be loaded with something like HTML. But you can't put water, you have to have a container (a bucket) to fill it, and this bucket is not on the truck.

Summary

Overall, Tomcat may never be the most important product of Apache, but no one can prevent Tomcat from becoming a mainstream product, and Apache will also give considerable attention to the youngest son.

"This article is the network collation, does not represent the 51CTO viewpoint"

"Editor's recommendation"

    1. Tomcat 6.0.28 released to fix multiple vulnerabilities
    2. Apache launches a number of important improvements to the first Tomcat 7 release
    3. TOMCAT 7.0 official documentation released beta version available for download
    4. Tomcat 7 stole away? The official version of the catalog already exists

The difference between a Web server parent and a child Apache and Tomcat

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.