Apache Tomcat 是基于 Apache Web Server 平台构建的吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/582156/
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
Is Apache Tomcat built on Apache Web Server platform?
提问by Geo
Recently our Software Analytic provider (NETTRACKER) sent us a plugin in order to be able to capture visitors in a better way. This plugin is for Apache 1.x and Apache 2.x. They said and I quote
最近,我们的软件分析提供商 ( NETTRACKER) 向我们发送了一个插件,以便能够以更好的方式捕获访问者。此插件适用于 Apache 1.x 和 Apache 2.x。他们说,我引用
that since Apache Tomcat is built on Apache HTTP server the configuration of the plugin should be the same.
因为 Apache Tomcat 是建立在 Apache HTTP 服务器上的,所以插件的配置应该是一样的。
I have looked for a httpd.conf in our tomcat deployment but we cannot find one, the only configuration that is similar to that one is the server.xml under the /conf directory.
我在我们的tomcat部署中找了一个httpd.conf,但是找不到,唯一类似的配置是/conf目录下的server.xml。
If someone has better information regarding these two incredible products (Apache HTTP server and Apache Tomcat) I will greatly appreciate to draw the differences.
如果有人对这两个令人难以置信的产品(Apache HTTP 服务器和 Apache Tomcat)有更好的信息,我将不胜感激指出差异。
EDIT: In case you are curious we know that Apache Web Server and Tomcat can work together using the mod_jk option and other proxys. But this will be too complex for our deployment.
编辑:如果您好奇,我们知道 Apache Web Server 和 Tomcat 可以使用 mod_jk 选项和其他代理一起工作。但这对我们的部署来说太复杂了。
回答by kgiannakakis
Apache Tomcat and Apache HTTP are completely different server technologies. It is impossible to use a plugin for Apache HTTP server with Tomcat.
Apache Tomcat 和 Apache HTTP 是完全不同的服务器技术。无法在 Tomcat 中使用 Apache HTTP 服务器的插件。
Apache HTTP server is developed in C and so are the plug-ins. On the contrary Tomcat is now completely developed in Java. Tomcat doesn't only serve static content, but it can also serve JSP pages and servlets.
Apache HTTP 服务器是用 C 开发的,插件也是如此。相反,Tomcat 现在完全是用 Java 开发的。Tomcat 不仅可以提供静态内容,还可以提供 JSP 页面和 servlet。
Tomcat is used for hosting Java Web Applications. It can sure serve static content - you can host a web application using only Tomcat. Secure connections are supported and the performance is also very good (comparable with the performance of HTTP server).
Tomcat 用于托管 Java Web 应用程序。它可以确保提供静态内容 - 您可以仅使用 Tomcat 来托管 Web 应用程序。支持安全连接,性能也很好(与HTTP服务器的性能相当)。
A plain installation of Apache serves static content. Using the appropriate plug-ins, HTTP requests can be redirected to an application server (Tomcat, JBoss, Glassfish) or a script language interpreter (PHP). With this way dynamic content can be generated. The big advantages of Apache are the numerous plug-ins available, which allows administrators to configure and monitor web sites any way they want and that is the most widespread server available. This makes it the most secure solution, since it is thoroughly tested and any discovered flaw is corrected very quickly.
Apache 的普通安装提供静态内容。使用适当的插件,可以将 HTTP 请求重定向到应用程序服务器(Tomcat、JBoss、Glassfish)或脚本语言解释器 (PHP)。通过这种方式,可以生成动态内容。Apache 的一大优点是可用的插件众多,它允许管理员以他们想要的任何方式配置和监控网站,这是最广泛的可用服务器。这使其成为最安全的解决方案,因为它经过了彻底的测试,任何发现的缺陷都会很快得到纠正。
The best solution would be to use Tomcat proxied by an Apache server. It isn't so difficult to set up. If you can't do this, then you can't take advantage of Apache's plug-ins.
最好的解决方案是使用由 Apache 服务器代理的 Tomcat。设置起来并不难。如果你不能做到这一点,那么你就无法利用 Apache 的插件。
回答by Luke
You see this confusion all the time. Many people think that Apache is a web server where in reality it is the name of an organization that has a web server project called "The Apache HTTP Server Project". In short the web server is called HTTPD (D as in daemon or Unix process).
你总是看到这种混乱。许多人认为 Apache 是一个 Web 服务器,而实际上它是一个组织的名称,该组织拥有一个名为“ Apache HTTP 服务器项目”的 Web 服务器项目。简而言之,Web 服务器称为 HTTPD(在守护进程或 Unix 进程中称为 D)。
Tomcatis another Apache project. This project implements a Java servlet engine to serve JSP pages and servlets. Tomcat and HTTPD have nothing to do with each other. However, you can set up HTTPD and Tomcat so that they work together. This way you can have HTTPD serve all static content, do URL rewriting and much more fancy stuff that the built in Tomcat web server can't do (or can't do very well). Whenever a JSP page is requested, HTTPD will pass the request on to Tomcat. Tomcat will process the request and will hand the output back to HTTPD which in turn will send it to the client.
Tomcat是另一个 Apache 项目。该项目实现了一个 Java servlet 引擎来为 JSP 页面和 servlet 提供服务。Tomcat 和 HTTPD 没有任何关系。但是,您可以设置 HTTPD 和 Tomcat,以便它们一起工作。通过这种方式,您可以让 HTTPD 为所有静态内容提供服务,进行 URL 重写以及更多内建的 Tomcat Web 服务器无法完成(或无法很好地完成)的奇特事情。每当请求 JSP 页面时,HTTPD 都会将请求传递给 Tomcat。Tomcat 将处理请求并将输出交回给 HTTPD,HTTPD 又将其发送给客户端。
Apache has many interesting projects. E.g. there is also a project called Geronimowhich is a Java Enterprise server (J2EE). You can e.g. choose to embed Tomcat inside Geronimo to handle requests for JSP's and servlets where Geronimo does the more enterprisy stuff (LDAP, Messaging etc.). And you guessed it probably already, you can use HTTPD as a static content server for Geronimo as well.
Apache 有许多有趣的项目。例如,还有一个名为Geronimo的项目,它是一个 Java 企业服务器 (J2EE)。例如,您可以选择在 Geronimo 中嵌入 Tomcat 来处理对 JSP 和 servlet 的请求,而 Geronimo 则在其中处理更多的企业事务(LDAP、消息传递等)。您可能已经猜到了,您也可以使用 HTTPD 作为 Geronimo 的静态内容服务器。
回答by Javier
totally bogus. Apache httpd plugins are written in C, Tomcat is pure Java.
完全是假的。Apache httpd 插件是用 C 编写的,Tomcat 是纯 Java 的。
回答by popcnt
Tomcat is a Java servlet engine. It can be hosted under Apache or IIS or quite a number of other external facing web servers. It sounds like you may be currently running your Tomcat instance standalone...
Tomcat 是一个 Java servlet 引擎。它可以托管在 Apache 或 IIS 或许多其他面向外部的 Web 服务器下。听起来您目前可能正在独立运行 Tomcat 实例...
If you serve the JSP/servlets off of port 8080 and have it do things standalone, on the same host machine that Apache is running on, this can allow you to have them loosely coupled. Having multiple web servers fielding independent requests is not recommended, especially if you want to use server-based authentication along with Apache. Typically, you have one outside facing server that shepherds everything through it... Apache does this quite well, and the plugin you mention probably relies on this type of setup (everything gets wired through Apache) for its features/capabilities, based on your brief description of it.
如果您在端口 8080 上提供 JSP/servlets 并让它在运行 Apache 的同一台主机上独立做事情,这可以让您将它们松散耦合。不建议让多个 Web 服务器处理独立的请求,特别是如果您想将基于服务器的身份验证与 Apache 一起使用。通常,您有一个面向外部的服务器,通过它来管理所有内容......对其的简要说明。
If you would like to serve up your Tomcat servlets under Apache, you could configure apache to forward a class of URIs to your tomcat server instances. you could achieve this type of forwarding through mod_rewrite. this is a slower option performance-wise, as it adds slight overhead on everything you server up. You could also proxy incoming requests via a CGI mechanism similarly, from Apache to Tomcat.
如果您想在 Apache 下提供您的 Tomcat servlet,您可以配置 apache 将一类 URI 转发到您的 tomcat 服务器实例。您可以通过 mod_rewrite 实现这种类型的转发。这是性能方面较慢的选项,因为它会在您服务器上的所有内容上增加轻微的开销。您还可以通过类似的 CGI 机制代理传入的请求,从 Apache 到 Tomcat。
mod_jkwill simplify deployment and increase performancefor placing Tomcat into an Apache server config. It is pretty painless to configure if you follow the docs, so I am not sure what you mean by "too complex" for your deployment -- if you want Apache and have Tomcat already, it would seem only a matter of slight config changes to get mod_jkdownloaded and installed.
mod_jk将简化部署并提高将 Tomcat 放入 Apache 服务器配置的性能。如果您按照文档进行配置是非常轻松的,所以我不确定您的部署“太复杂”是什么意思——如果您想要 Apache 并且已经拥有 Tomcat,那么似乎只是对配置进行轻微的更改得到mod_jk的下载和安装。

