In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Apache and Tomcat are web servers, both have connections and differences, in the development process of HTML, PHP, JSP, Perl, etc., we need to accurately grasp their respective characteristics, select the best server configuration.
Apache is a web server (static parsing such as HTML), tomcat is a java application server (dynamic parsing such as JSP, PHP)
Tomcat is just a servlet container, which can be considered an extension of apache, but can run independently of apache.
The two can be compared from the following points:
Both were developed by Apache.
2. Both have HTTP service functions
Both are open source and free.
contact
1) Apache is an ordinary server, which only supports html, that is, ordinary web pages. It can support php through plug-ins, and can also communicate with Tomcat (Apache connects Tomcat in one way, that is, Tomcat resources can be accessed through Apache, otherwise).
Apache only supports static web pages, but dynamic web pages such as ASP, JSP, PHP, CGI, etc. need Tomcat to process.
Apache and Tomcat integration:
If the client requests 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, parses the JSP and other web page codes, and returns them to the Apache server, and then returns them to the browser via Apache.
This is because jsp is server-side interpretation code, Tomcat only does dynamic code parsing, Apache returns parsed static code, Apache+Tomcat integration can reduce Tomcat service overhead.
Apache and Tomcat are independent and can be integrated on the same server.
difference
Apache is implemented in C and supports various features and modules to extend core functionality;Tomcat is written in Java and better supports Servlets and JSP.
Apache is a Web server, Web servers serve pages that browsers can browse, Web servers specifically handle HTTP requests, but application servers serve business logic for applications through many protocols.
Tomcat is an application server that runs on Apache and provides methods that client applications can call. It's just a servlet container that can be considered an Apache extension, but can run independently of Apache.
Apache is an ordinary server, which only supports html static ordinary web pages. However, PHP can be supported through plug-ins, and Tomcat can also be connected (one-way Apache connection Tomcat, that is, Tomcat resources can be accessed through Apache, otherwise), Tomcat is a jsp/servlet container, and also supports HTML, JSP, ASP, PHP, CGI, etc., wherein CGI requires some manual debugging, but it is very easy.
Apache focuses on http server, Tomcat focuses on servlet engine, if run in standalone mode, Tomcat and apache support JSP equivalent in function, but it is not ideal for static web pages.
Apache can run for a year without restarting, stability is very good, and Tomcat is not necessarily.
5, the preferred web server is Apache, but Apache can not resolve the jsp, servlet only use tomcat.
Apache is the very beginning of the page parsing service, tomcat is developed later, essentially tomcat's function can completely replace Apache, but Apache is tomcat's predecessor, and there are many people on the market still using Apache, so Apache will continue to exist, will not be replaced, apache can not parse java things, but parsing html speed is fast.
Examples of both:
Apache is a car, it can be loaded with some things such as html, etc., but can not hold water, to hold water must have a container (bucket), and this bucket can not be placed on the truck, that bucket is TOMCAT.
Integration of both:
Apache is a web server environment program, enabling him to be used as a web server, but only supports static web pages, does not support dynamic web pages, such as asp, jsp, php, cgi
If you want to run jsp in Apache environment, you need an interpreter to execute jsp web pages, and this jsp interpreter is Tomcat.
So why JDK? Because jsp needs to connect to the database, jdk is required to provide the drive to connect to the database, so APACHE+TOMCAT+JDK is required to run the web server platform of jsp.
Benefits of integration:
If the client requests 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 server-side interpreted code, this integration reduces Tomcat service overhead
summary
The above is what is the difference between Apache and Tomcat introduced by Xiaobian. I hope it will help you. If you have any questions, please leave a message to me. Xiaobian will reply to you in time. Thank you very much for your support!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.