`
xitongyunwei
  • 浏览: 925837 次
文章分类
社区版块
存档分类
最新评论

Tomcat vs Apache

 
阅读更多

Tomcat vs Apache:您钟情于哪一款


本文探讨了ApacheApache Tomcat之间的区别,帮助开发者选择更加适宜的Web服务器。

当你选择使用哪种Web服务器时,或许会因它们的差异性和技术细节等方面而困扰。如何区分Web服务器以及如何为你的项目挑选一款最佳的Web服务器,或许对你来说这是一个很难的决定。鉴于Apache目前最流行的一款Web服务器,本文将探讨Apache与Apache Tomcat两者之间的区别,以满足不同开发者的需求。

Apache Web服务器通常比称之为“Apache”或者“httpd”,1995年由Robert Mc Cool和他的团队开发,由Apache软件基金会提供支持与维护。Apache是目前最流行的Web应用服务器,拥有超过一亿的网站用户,占据互联网应用服务器63%的份额,以及全球最繁忙网站中有66%采用Apache的(比方说,维基百科网站服务器就是使用Apache)。


Apache

Apache获得了巨大的成就,它是一项完全开源的项目,其成功的大部分原因应归功于免费、稳定且性能卓越。Apache Web服务器是一个用C语言实现的HTTP Web服务器,支持各种特性和模块从而来扩展核心功能。

Apache的优越特性:

  • 访问静态页面比Tomcat要快
  • Apache有更多的配置选项
  • 支持CGI 脚本,Server API模块,Perl,PHP等

Apache最大的缺点是不支持Java Servlets或JavaServer Pages(JSP),无法在Apache Web服务器上运行,Tomcat由此而诞生。


Apache Tomcat

Apache Tomcat又被称之为“Tomcat”是一款开源的Web服务器,Jakarta项目中的一个核心项目,1999年被开发而成,支持Servlet和JSP,由Apache软件基金会提供支持与维护。

Tomcat是靠Java实现的,支持Java Servlets和JavaServer Pages(JSP),由Oracle公司指定的,因JSPs而著称。

Tomcat部分是Apache服务器的扩展,但它是独立运行的,所以当Apache Tomcat运行tomcat时,它实际上是作为一个与Apache独立的进程单独运行的。

提供Tomcat独立运行的几个不同的安装方法:

  1. 当运行在Java-based Web服务器时,Tomcat可以“独立”的模式使用,可当做Web服务器的组件。Tomcat将成为在你的JSP环境中管理和以用户名义调用servlets的一种servlets容器,大都数Web服务器不是Java-based系统,这也就意味着你必须选择一个不同的安装设置。
  2. 当Tomcat配置Apache服务器运行时,你可以以一个附加的Servlet容器运行“in-process”,就像是以独立的模式运行,但是必须与Apache相结合。它以Web服务器插件和Java容器实现的一种组合可运行在JVM之外的Web服务器。该方法非常适合多线程,单一进程服务器且提供良好的性能。
  3. “out-of-process”,允许Tomcat以Web服务器插件和Java容器实现的一种组合可在Web服务器之外运行。通过使用IPC机制如TCP/IP通信协议来传输Java容器JVM和Web服务器插件之间的数据。当有请求被发送至Web服务器时,通过Servlet请求插件接收request,并把request传输给Java容器。与运行“in-process”相反,当响应时间不在最佳状态时,用“out-of-process”方式能够帮助你更好地执行可扩展性和稳定性。

Tomcat的优越特性:

  • 提供Java Servlet和JSP支持动态服务器网页
  • 一个轻量级应用服务器
  • 可在不同的模式中运行,以提高其性能

如果你对它们都感兴趣的话,这里还提供了Apache trainingTomcattraining学习课程。

对于用户来说,如果你需要运行Java Servlets或者JavaServer pages(JSP),Tomcat绝对是你最好的选择;但如果你需要运行大量的静态页面(HTML)或者其他的一些动态技术(PHP、Perl),你可以选择Apache或者Tomcat的“in- process”或者“out-of-process”模式。 无论是哪一种,你都无须为为它支付任何费用,不是吗?

======================================================================================

Tomcat vs. Apache: Why One Over the Other


When determining which type of web server to use, the differences and technical details can be daunting. It can be a difficult task to compare web servers and make the decision on which is best for you and your project. Since Apache is currently the most popular web server, this article will discuss the differences between the Apache Web Server and Apache Tomcat, which are very different and fulfill different needs.

The Apache Web Server, often just called “Apache” or “httpd”, was developed in 1995 by Robert McCool and continuous development as well as maintenance is provided by the Apache Software Foundation. Known as the most popular web server, it has surpassed over 100 million websites and serves 63% of all websites as well as 66% of the million busiest. This is a huge accomplishment for a server that is an entirely an open-source project but the fact that it is free is one of the biggest reason for such a huge following.


Apache

The Apache Web Server is a C language implementation of an HTTP web server and can run a variety of features and modules to extend the core functionality.

Here are some points in favor of the Apache Web Server over Tomcat:

  • It is faster than Tomcat when serving static pages
  • Apache has more configuration options than Tomcat
  • Supports CGI scripts, Server API modules, Perl, PHP, etc…

The big downside for Apache is the lack of functionality for Java Servlets or JavaServer Pages, which cannot be run with Apache’s web server. Tomcat was created to address this problem.


Apache Tomcat

Apache Tomcat, otherwise known as “Tomcat” is an open-source web server that started as a servlet reference in 1999 and is developed and maintained by the Apache Software Foundation. It is a Java implementation that runs Java Servlets and JavaServer Pages, known as JSPs, as specified from Oracle. Often used together, Tomcat can be a valuable addition to your Apache Web Server installation; however, Tomcat can also stand on its own as a web server without Apache.

There are different installation methods and way that Tomcat can run to either supplement your Apache Web Server or run on its own:

  • When running a Java-based web server, Tomcat can be used in “standalone” mode, which allows it to be used as a component to the web server. Tomcat will become a servlet container in your JSP environment that manages and invokes servlets on behalf of users. However, most web servers are not Java-based, which means you have to choose a different installation setup.
  • When running Tomcat with Apache, you can run it “in-process” as an add-on servlet container, much like it would run in standalone mode but in conjunction with Apache. It runs as a combination of web server plugin and Java container implementation that runs in a JVM outside the web server. This method is great for multi-threaded, single-process servers and provides good performance at the price of scalability.
  • The last installation method is “out-of-process”, which allows Tomcat to run as a combination of a web server plugin and Java container implementation that runs outside of the web server. Communication between the Java container JVM and the web server plugin happens using an IPC mechanism such as TCP/IP sockets. When a request comes in to the web server that requires a Servlet, the plugin takes over the request and passes it to the Java container. You get the opposite benefits of running “in-process” since the response time is not as optimal but the “out-of-process” method performs better in scalability and stability.

Here are some points in favor of Tomcat over Apache httpd Web Server:

  • Provides the Java Servlet and JSP support for dynamically served pages
  • Works as a light-weight testing server
  • Can be run in different modes to promote better performance

If you are interested in learning beyond the overview of each server, we provide bothApache trainingandTomcat trainingcourses as part of LearnComputer’s regular curriculum.

For users that need to run Java Servlets or JavaServer pages, Tomcat is definitely the best implementation for you. However, if you are running a lot of static pages or need other dynamic techniques, you may want to stick with the Apache Web Server and run Tomcat either in- or out-of-process to get the Java support that you need. Either way, you will know that you are running one of the best web servers available without having to pay unnecessary cost for it.


翻译原文:

Tomcat vs Apache:您钟情于哪一款(中文)

Tomcat vs ApacheWhy One Over the Other(英文)


分享到:
评论

相关推荐

    TomCat与Apache整合

    TomCat Apache 整合TomCat Apache 整合TomCat Apache 整合TomCat Apache 整合TomCat Apache 整合TomCat Apache 整合

    Tomcat+Apache集群安装指南.pdf

    本文为您讲述了如何在 Windows 或 Linux 下进行 Tomcat 集群的安装配置。 Windows 下 Tomcat 集群的安装配置与 Linux 下...使用 Apache作为集群的代理服务器(它可以安装在任何一台机 器上),它同时也负责负载均衡。

    Apache tomcat6.0 java开发工具 Apache tomcat6.0 Apache tomcat6.0

    Apache tomcat6.0 java开发工具 Apache tomcat6.0 Apache tomcat6.0

    tomcat7 http://tomcat.apache.org/download-70.cgi

    http://tomcat.apache.org/download-70.cgi http://tomcat.apache.org/download-70.cgi

    tomcat+apache 6.0集成打包

    本压缩包中包含tomcat+apache6.0版本全部必备软件(apache 2.2.8,Tomcat 6.0.16,JK-apache-2.0.55)以及安装配置说明文档。

    IIS、TOMCAT和APACHE整合

    IIS、TOMCAT和APACHE三者之间的整合,共用同一个端口

    apache-tomcat-8.0.51.rar_Java 8_Tomcat/8.0.51_apache基金会_tomcat

    Tomcat是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目,由Apache、Sun 和其他一些公司及个人共同开发而成。由于有了Sun 的参与和支持,最新的Servlet 和JSP 规范总是能在Tomcat ...

    Linux下Tomcat与Apache Web服务器整合

    Linux下Tomcat与Apache Web服务器整合

    apache-tomcat-7.0.53

    apache-tomcat-7.0.53apache-tomcat-7.0.53apache-tomcat-7.0.53apache-tomcat-7.0.53

    tomcat, Apache Tomcat镜像.zip

    tomcat, Apache Tomcat镜像 欢迎使用 Apache !是什么?Java Servlet 。javaserverpages 。Java表达式语言和 Java web socket规范在社区进程开发。Apache软件正在开放和参与的环境中开发,并在许可版 2下发布

    apache-tomcat-7.0.75.zip

    Tomcat是由Apache软件基金会下属的Jakarta项目开发的一个Servlet容器,按照Sun Microsystems提供的技术规范,实现了对Servlet和JavaServer Page(JSP)的支持,并提供了作为Web服务器的一些特有功能,如Tomcat管理和...

    apache-tomcat-9.0.6.zip

    apache-tomcat-9.0.6 apache-tomcat-9.0.6 apache-tomcat-9.0.6 apache-tomcat-9.0.6 apache-tomcat-9.0.6 apache-tomcat-9.0.6 apache-tomcat-9.0.6 apache-tomcat-9.0.6 apache-tomcat-9.0.6 apache-...

    windows下整合apache和tomcat服务器的方法

    文档中详细的介绍了如何在windows下配置apache,tomcat之间的整合方法,前提是你已经安装好了apache,tomcat,mod_jk等工具,里面详细的介绍了安装过程中可能遇到的问题,并给出了注意事项。

    apache-tomcat-7.0.57

    Tomcat是由Apache软件基金会下属的Jakarta项目开发的一个Servlet容器,按照Sun Microsystems提供的技术规范,实现了对Servlet和JavaServer Page(JSP)的支持,并提供了作为Web服务器的一些特有功能,如Tomcat管理...

    Tomcat7下载(apache-tomcat-7.0.85)

    Tomcat7下载(apache-tomcat-7.0.85)Tomcat7下载(apache-tomcat-7.0.85)Tomcat7下载(apache-tomcat-7.0.85)Tomcat7下载(apache-tomcat-7.0.85)

    apache-tomcat-10.0.8.zip

    Apache Tomcat 软件是Jakarta Servlet、 Jakarta Server Pages、 Jakarta Expression Language、 Jakarta WebSocket、 Jakarta Annotations和 Jakarta Authentication 规范的开源实现 。 压缩包内容: apache-...

    Tomcat:apache-tomcat-6.0.18

    Tomcat服务器apache-tomcat-6.0.18版

    Tomcat与apache整合(完整论述)

    在Windows下,Tomcat与apache整合,根据实际情况进行完整论述了整个配置的过程。

    tomcat+apache整合插件大全及整合方法

    tomcat+apache整合插件大全及整合方法

Global site tag (gtag.js) - Google Analytics