Differences and connections between APACHE and tomcat

Source: Internet
Author: User
Tags url forwarding

I often use Apache, tomcat, and other servers, but I still don't know the relationship between them. I am confused when I use tomcat, in the end, who is the primary user and who is the secondary user? Therefore, I found some materials on the Internet and summarized them as follows:

I

Apache supports static pages. Tomcat supports dynamic pages, such as servlets,

If Apache + Tomcat is used, Apache is only used as a forward object, and JSP processing is handled by Tomcat.

Apache supports PHP \ cgi \ Perl, but to use Java, you need to support tomcat in the Apache background to forward Java requests to Tomcat for processing.

ApacheYes Web Server, TomcatIs an application (Java) server. It is just a servlet (JSP is also translated into servlet) container and can be consideredApacheBut can be independentApacheRun.

 

The two have the following points for comparison:
1. Both are developed by Apache.
2. Both have HTTP service functions
3. Both are free.

Differences:
Apache provides HTTP services and related configurations (such as virtual hosts and URL forwarding)
Tomcat is a JSP server developed by Apache in compliance with J2EE JSP and Servlet standards.

II:

Apache is a web server environment program that can be used as a Web server. However, Apache does not support dynamic webpages such as ASP, PHP, CGI, and JSP.
If you want to run JSP in Apache, you need an interpreter to execute the JSP webpage. This JSP interpreter is tomcat. Why JDK? Because JSP needs to connect to the database
JDK is required to provide a path to connect to the database, so Apache + Tomcat + JDK is required to run the JSP web server platform.

The benefits of integration are:
If the client requests a static page, the Apache server only needs to respond to the request.
If the client requests a dynamic page, the Tomcat server responds to the request.
Because JSP is interpreted on the server side, so integration can reduce Tomcat service overhead

III:

Apache: focuses on HTTP Server
Tomcat: focuses on the servlet engine. If it runs in standalone mode, it is functionally equivalent to Apache and supports JSP, but it is not ideal for static web pages;
Apache is a Web server, and Tomcat is an application (Java) server. It is just a servlet (JSP is also translated into servlet) container. It can be considered as an extension of Apache, but it can run independently of Apache.
In other words, Apache is a truck with some things such as HTML. But you cannot hold water. To hold water, you must have a container (bucket) instead of a truck.

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.