The difference and connection between Apache and Tomcat

Source: Internet
Author: User
Tags tomcat server url forwarding

Often in Apache and Tomcat and so on these servers, but the total feeling still do not know what the relationship between them, when using Tomcat always appear Apache, always feel puzzled, who is the Lord who is the time, so deliberately on the internet to inquire some of this information, summed up a bit:

(a) Apache support static pages, tomcat support dynamic, such as servlet, such as the general use of Apache+tomcat,Apache just as a forwarding, the processing of the JSP is handled by Tomcat . Apache can support Php\cgi\perl, but to use Java, you need Tomcat to support Apache in the background and transfer Java requests from Apache to Tomcat processing. 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:

1, both are developed by Apache organizations

2, both have the function of HTTP service

3. Both are free

Different points:

Apache is specifically used to provide HTTP services, and related configuration (such as virtual host, URL forwarding, etc.) tomcat is the Apache organization in accordance with the Java EE JSP, the servlet standard development of a JSP server.

(ii) Apache is a Web server environment program, enabled he can be used as a Web server, but only support static Web pages, such as (asp,php,cgi,jsp) and other dynamic Web pages. 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 requests a static page, only the Apache server responds to the request, and 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.

(iii)   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.

The difference and connection between 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.