Tomcat vs Apache:您钟情于哪一款
本文探讨了Apache与Apache 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独立运行的几个不同的安装方法:
- 当运行在Java-based Web服务器时,Tomcat可以“独立”的模式使用,可当做Web服务器的组件。Tomcat将成为在你的JSP环境中管理和以用户名义调用servlets的一种servlets容器,大都数Web服务器不是Java-based系统,这也就意味着你必须选择一个不同的安装设置。
- 当Tomcat配置Apache服务器运行时,你可以以一个附加的Servlet容器运行“in-process”,就像是以独立的模式运行,但是必须与Apache相结合。它以Web服务器插件和Java容器实现的一种组合可运行在JVM之外的Web服务器。该方法非常适合多线程,单一进程服务器且提供良好的性能。
- “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 training和Tomcattraining学习课程。
对于用户来说,如果你需要运行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 Apache:Why One Over the Other(英文)
分享到:
相关推荐
### Tomcat+Apache集群安装指南知识点汇总 #### 一、概述 本文主要介绍了如何在Windows和Linux环境下搭建Tomcat集群并使用Apache作为集群的代理服务器和负载均衡器。通过本指南,读者可以学习到在不同操作系统下...
http://tomcat.apache.org/download-70.cgi http://tomcat.apache.org/download-70.cgi
这个压缩包包含了Apache 2.2.8和Tomcat 6.0.16这两个特定版本,以及JK模块(即mod_jk)的2.0.55版,它们是Apache与Tomcat间通信的关键组件。JK模块是Apache的负载均衡和反向代理模块,使得Apache能够处理静态内容,...
在IT行业中,IIS(Internet Information Services)、Tomcat和Apache都是常见的Web服务器,它们各自有着不同的特性和用途。本文将详细探讨如何实现这三种服务器的整合,以及它们共用同一个端口的可能性。 首先,让...
2. **下载并安装JK模块:** 从Apache官方或Apache Tomcat官方网站获取mod_jk.so,并将其放在Apache的modules目录下。 3. **配置Apache:** 在Apache的httpd.conf中,加载mod_jk模块,并配置JK模块的相关指令,如`...
Apache Tomcat 6.0是Java Web应用服务器,主要用于运行基于Java Servlet和JavaServer Pages (JSP)的应用程序。它是Apache软件基金会Jakarta项目的一部分,以其开源、免费和高效的特性深受开发者喜爱。在这个版本中,...
【标题】:“Tomcat+Apache集群配置实例” 在IT领域,服务器集群是一种常见的高可用性和负载均衡解决方案。这里我们将深入探讨如何配置一个基于Tomcat和Apache的集群环境,以提高Web应用的服务质量和应对高流量场景...
如果是动态内容,Apache会通过AJP(Apache JServ Protocol)将请求转发给Tomcat处理,然后Tomcat返回处理结果给Apache,再由Apache返回给客户端。这种方式充分利用了Apache处理静态文件的效率和Tomcat对动态内容的...
Tomcat是由Apache软件基金会属下Jakarta项目开发的Servlet容器,按照Sun Microsystems提供的技术规范,实现了对Servlet和JavaServer Page(JSP)的支持,并提供了作为Web服务器的一些特有功能,如Tomcat管理和控制...
tomcat, Apache Tomcat镜像 欢迎使用 Apache !是什么?Java Servlet 。javaserverpages 。Java表达式语言和 Java web socket规范在社区进程开发。Apache软件正在开放和参与的环境中开发,并在许可版 2下发布
Apache Tomcat 8.0.26 是一个广泛使用的开源软件,它是一个Java Servlet容器,专为部署Java Web应用程序而设计。Tomcat是Apache软件基金会的Jakarta项目的一部分,遵循Apache 2.0许可证,因此它是免费且开源的。这个...
【Linux下Tomcat与Apache Web服务器整合】 在互联网和企业网络应用中,Web技术占据了核心地位,TCP/IP协议和Web服务器是实现这一目标的关键组成部分。Linux操作系统因其稳定性和开源特性,成为了众多企业和开发者的...
**标题:“Tomcat与Apache服务器集成”** 在Web开发领域,Apache HTTP Server(简称Apache)和Tomcat都是广泛使用的服务器软件。Apache以其稳定性和灵活性著称,主要用于处理静态内容;而Tomcat则是一个轻量级的...
Tomcat是由Apache软件基金会下属的Jakarta项目开发的一个Servlet容器,按照Sun Microsystems提供的技术规范,实现了对Servlet和JavaServer Page(JSP)的支持,并提供了作为Web服务器的一些特有功能,如Tomcat管理...
### Tomcat与Apache整合知识点详解 #### 一、Apache与Tomcat的区别与联系 1. **功能定位**: - **Apache**:主要用于提供HTTP服务,支持多种类型的静态页面(如HTML、CSS、JS等),同时也支持通过插件扩展来处理...
Tomcat是由Apache软件基金会下属的Jakarta项目开发的一个Servlet容器,按照Sun Microsystems提供的技术规范,实现了对Servlet和JavaServer Page(JSP)的支持,并提供了作为Web服务器的一些特有功能,如Tomcat管理和...
Apache Tomcat是一个开源的软件应用服务器,主要用于运行Java Servlets和JavaServer Pages(JSP)。在本案例中,我们讨论的是版本10.0.20,这是一个重要的更新,包含了性能改进、安全修复以及可能的新功能。Apache ...
在IT行业中,尤其是在服务器端应用部署领域,Apache和Tomcat的整合是一个常见的需求。Apache作为一款功能强大的HTTP服务器,能够处理静态内容,而Tomcat则是Java Servlet和JavaServer Pages(JSP)的容器,用于处理...