apache - Apache应该服务什么,Tomcat应该服务什么?

标签 apache tomcat static-content

我正在尝试在 Tomcat 前面设置 Apache。 Apache 提供什么服务?我知道 Apache 更适合静态页面和图像。我目前在 Tomcat 中部署了一个 war 文件,其中包含静态页面、图像和 Flash 文件。我应该把这些都放在 Apache 服务器上吗?如何从 Tomcat 应用程序引用这些页面/图像?

我想使用 Apache 来减小 war 文件的大小并希望更快地提供图像。是否有关于设置 Apache 和 Tomcat 以及放置内容的良好指南?

最佳答案

您的 Tomcat 服务器是否存在性能/负载问题?如果您需要(性能、安全性等),请这样做,但如果没有,请不要让事情变得更复杂不需要。

它曾经是在 Tomcat 前端使用 Apache 服务器的标准,但最近版本的 Tomcat 可以(并且经常)用作 HTTP 服务器和 Servlet 容器。

看看 Tomcat Connector FAQ有关该主题的信息。

Why should I integrate Apache with Tomcat? (or not)

There are many reasons to integrate Tomcat with Apache. And there are reasons why it should not be done too. Needless to say, everyone will disagree with the opinions here. With the performance of Tomcat 5 and 6, performance reasons become harder to justify.

...

Speed. Apache is faster at serving static content than Tomcat. But unless you have a high traffic site, this point is useless. But in some scenarios, tomcat can be faster than Apache httpd. So benchmark YOUR site. Tomcat can perform at httpd speeds when using the proper connector (APR with sendFile enabled). Speed should not be considered a factor when choosing between Apache httpd and Tomcat

关于apache - Apache应该服务什么,Tomcat应该服务什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4753552/

相关文章:

java - Tomcat : How to know the deployment location of my webapplication

java - JNDI 失败,出现 javax.naming.NameNotFoundException :Name [jdbc/Database] is not bound in this Context when deploying Spring Boot2 Tomcat 9 NO EMBEDDED

tomcat - Elasticsearch - Spring boot : None of the configured nodes are available

java - 如何让 Weblogic 8.1 提供静态内容?

java - 在 Java Web 应用程序中从应用程序服务器外部提供静态数据的最简单方法,但在 WEB LOGIC 中

php - 将运行用户从 nt authority\system 更改为 AD 用户 - Windows 上的 Apache

PHP 脚本不在本地主机上运行

php - 无法从 .htaccess 生成的 url 获取变量

php - 脚本在实时服务器上运行良好但在 wamp 上运行不正常

angular - 如何在没有 web.config 的情况下从 Azure 公开和提供 WOFF 文件?