Apache vs Tomcat
上一篇 /
下一篇 2008-04-12 14:20:02
/ 个人分类:Server
51Testing软件测试网G&B5cj+_K&oEWApache 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. This is generally prefered when using tomcat because the overhead from serving static content directly from Apache is much lower than having Tomcat handle all of the requests.
%dx*I0A:LAP3G0#w8n4L2[$YP6N/q@?#k0本质区别:
LBYO1Vu N$~5E s01)51Testing软件测试网z_!{ v#zD;XS
zc)P
apache支持静态页面;51Testing软件测试网3YcrU5zWS
tomcat支持动态页面,比如servlet等。
|$P_}Vm4Vctfy02)
VO RoJ-nr&}9I5f0apache是web(http)服务器,它是专门用于提供HTTP服务,以及相关配置的(例如虚拟主机、URL转发等等)
_(^A%JUXQ8_p0tomcat是应用(java)服务器,它只是一个servlet(jsp)容器,可以认为是apache的扩展,但是可以独立于apache运行。
2}1~[1q#?G*\aV2]4vg03)
3Mx#i9P@P8a0apache是一辆卡车,上面可以装一些东西如html等。但是不能装水,要装水必须要有容器(桶),而这个桶也可以不放在卡车上。51Testing软件测试网],x(lH2y;k7S
0Q0n@k$[
c0K JL0使用区别:
c U(v`$e0tomcat 作为 jsp,servlet 容器,虽然有静态解析功能,但性能上与 apache 相比相差很远。
}9E*]Ay3GF0apache 可以运行一年不重启,稳定性非常好,而 tomcat 则不见得。51Testing软件测试网Xp)WHV!q}
pi
51Testing软件测试网O3y6\D!A$gU }(?
整合:51Testing软件测试网/q)^Q1q8t1D~jnrR:w
一般使用apache+tomcat的话,apache只是作为一个转发,对jsp的处理是由tomcat来处理的。51Testing软件测试网"x$J&t.Hfn Q
ZKs1lg&b0整合的好处是:
~(S1g,Rgbp y
mC0如果客户端请求的是静态页面,则只需要Apache服务器响应请求,apache 解析 html 等静态网页非常快,是经过无数测试证明的。51Testing软件测试网mC_}D(j,EG2N
如果客户端请求动态页面,则是Tomcat服务器响应请求。
*o|7RP5e1P+J0因为jsp是服务器端解释代码的,这样整合就可以减少Tomcat的服务开销。51Testing软件测试网,o/M#Tl%U pkyb
m9h8W2AhGw0
?'ju5}{-S0
相关阅读:
- SQL Server 2008再次跳票 推至三季度 (51testing, 2008-1-29)
- 提供连接SQL SERVER、ACCESS数据库的两种方式 (51testing, 2008-1-30)
- SQL Server仍占据数据库市场主导地位 (51testing, 2008-2-21)
- 在Windows Server Cluster中安装非cluster程序 (luxuabc, 2008-2-25)
- 如何升级Windows Server 2003到Windows Server 2003 R2 (luxuabc, 2008-3-03)
- SQL Server中删除重复数据最快的方法 (51testing, 2008-3-07)
- 详细讲解SQL Server索引的性能问题 (51testing, 2008-3-20)
- SQL Server字符串处理函数大全 (51testing, 2008-3-26)
- SQL Server中六种数据移动的方法 (51testing, 2008-3-31)
- SQL SERVER 存储过程基础集 (51testing, 2008-4-01)
收藏
举报
TAG:
Server