Apache HTTP Server 和 Apache Tomcat 的区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30632/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between the Apache HTTP Server and Apache Tomcat?
提问by kaybenleroll
What is the difference in terms of functionality between the Apache HTTP Server and Apache Tomcat?
Apache HTTP Server 和 Apache Tomcat 在功能方面有什么区别?
I know that Tomcat is written in Java and the HTTP Server is in C, but other than that I do not really know how they are distinguished. Do they have different functionality?
我知道 Tomcat 是用 Java 编写的,而 HTTP Server 是用 C 编写的,但除此之外我真的不知道它们是如何区分的。它们有不同的功能吗?
采纳答案by Bernie Perez
Apache Tomcat is used to deploy your Java Servlets and JSPs. So in your Java project you can build your WAR (short for Web ARchive) file, and just drop it in the deploy directory in Tomcat.
Apache Tomcat 用于部署 Java Servlet 和 JSP。因此,在您的 Java 项目中,您可以构建 WAR(Web ARchive 的缩写)文件,并将其放在 Tomcat 的部署目录中。
So basically Apache is an HTTP Server, serving HTTP. Tomcat is a Servlet and JSP Server serving Java technologies.
所以基本上 Apache 是一个 HTTP 服务器,为 HTTP 服务。Tomcat 是一个服务于 Java 技术的 Servlet 和 JSP 服务器。
Tomcat includes Catalina, which is a servlet container. A servlet, at the end, is a Java class. JSP files (which are similar to PHP, and older ASP files) are generated into Java code (HttpServlet), which is then compiled to .class files by the server and executed by the Java virtual machine.
Tomcat 包括 Catalina,它是一个 servlet 容器。最后,servlet 是一个 Java 类。JSP文件(类似于PHP,和较旧的ASP文件)生成Java代码(HttpServlet),然后由服务器编译成.class文件,由Java虚拟机执行。
回答by ethyreal
In addition to the fine answers above, I think it should be said that Tomcat has it's own HTTP server built into it, and is fully functional at serving static content too. Depending on your java virtual machine configuration it can actually outperform going through traditional connectors in apache such as mod_proxy and mod_jk.
除了上面的好答案之外,我认为应该说 Tomcat 内置了自己的 HTTP 服务器,并且在提供静态内容方面也具有完整的功能。根据您的 java 虚拟机配置,它实际上可以胜过通过 apache 中的传统连接器,例如 mod_proxy 和 mod_jk。
That said a fully optimized Tomcat server should serve static files fast and if you have Java servlets, JSPs and ColdFusion files in addition to static content you may find tomcat does an excellent job by itself.
也就是说,一个完全优化的 Tomcat 服务器应该可以快速提供静态文件,如果除了静态内容之外,您还有 Java servlet、JSP 和 ColdFusion 文件,您可能会发现 tomcat 本身就做得非常出色。
回答by Satish Dhiman
- Apache is a general-purpose http server, which supports a number of advanced options that Tomcat doesn't.
- Although Tomcat can be used as a general purpose http server, you can also set up Apache and Tomcat to work together with Apache serving static content and forwarding the requests for dynamic content to Tomcat.
- Apache 是一个通用的 http 服务器,它支持许多 Tomcat 不支持的高级选项。
- 尽管 Tomcat 可以用作通用 http 服务器,但您也可以将 Apache 和 Tomcat 设置为与 Apache 一起工作,提供静态内容并将动态内容的请求转发给 Tomcat。
回答by levand
Tomcat is primarily an application server, which serves requests to custom-built Java servlets or JSP files on your server. It is usually used in conjunction with the Apache HTTP server (at least in my experience). Use it to manually process incoming requests.
Tomcat 主要是一个应用程序服务器,它处理对服务器上的定制 Java servlet 或 JSP 文件的请求。它通常与 Apache HTTP 服务器结合使用(至少以我的经验)。使用它来手动处理传入的请求。
The HTTP server, by itself, is best for serving up static content... html files, images, etc.
HTTP 服务器本身最适合提供静态内容...... html 文件、图像等。
回答by streak
an apache server is an http server which can serve any simple http requests, where tomcat server is actually a servlet container which can serve java servlet requests.
一个 apache 服务器是一个 http 服务器,它可以服务于任何简单的 http 请求,其中 tomcat 服务器实际上是一个可以服务 java servlet 请求的 servlet 容器。
Web server [apache] process web client (web browsers) requests and forwards it to servlet container [tomcat] and container process the requests and sends response which gets forwarded by web server to the web client [browser].
Web 服务器 [apache] 处理 Web 客户端(Web 浏览器)请求并将其转发到 servlet 容器 [tomcat],容器处理请求并将响应发送到 Web 服务器转发到 Web 客户端 [浏览器]。
Also you can check this link for more clarification:-
您也可以查看此链接以获取更多说明:-
https://sites.google.com/site/sureshdevang/servlet-architecture
https://sites.google.com/site/sureshdevang/servlet-architecture
Also check this answer for further researching :-
另请检查此答案以进行进一步研究:-
回答by vishal
If you are using java technology(Servlet/JSP) for making web application you will probably use Apache Tomcat. However, if you are using other technologies like Perl, PHP or ruby, its better(easier) to use Apache HTTP Server.
如果您使用 Java 技术(Servlet/JSP)制作 Web 应用程序,您可能会使用 Apache Tomcat。但是,如果您使用 Perl、PHP 或 ruby 等其他技术,则使用 Apache HTTP Server 更好(更容易)。
回答by yadul
Well, Apache is HTTP webserver, where as Tomcat is also webserver for Servlets and JSP. Moreover Apache is preferred over Apache Tomcat in real time
嗯,Apache 是 HTTP 网络服务器,而 Tomcat 也是 Servlet 和 JSP 的网络服务器。此外,Apache 在实时性方面优于 Apache Tomcat
回答by Karthikeyan
Apache is an HTTP web server which serve as HTTP.
Apache 是一个 HTTP Web 服务器,用作 HTTP。
Apache Tomcat is a java servlet container. It features same as web server but is customized to execute java servlet and JSP pages.
Apache Tomcat 是一个 java servlet 容器。它的功能与 web 服务器相同,但被定制为执行 java servlet 和 JSP 页面。

