Apache vs Tomcat

上一篇 / 下一篇  2008-04-12 14:20:02 / 个人分类:Server

51Testing软件测试网G&B5cj+_K&oEW

Apache 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$~5Es01)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$[ c0KJ L0使用区别
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,Rg bp y mC0如果客户端请求的是静态页面,则只需要Apache服务器响应请求,apache 解析 html 等静态网页非常快,是经过无数测试证明的。51Testing软件测试网mC_}D(j,EG2N
如果客户端请求动态页面,则是Tomcat服务器响应请求。
*o|7RP5e1P+J0因为jsp是服务器端解释代码的,这样整合就可以减少Tomcat的服务开销。51Testing软件测试网,o/M#Tl%Upkyb

m9h8W2AhGw0

?'ju5}{-S0

TAG: Server

 

评分:0

我来说两句

我的栏目

日历

« 2024-04-07  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 2137
  • 日志数: 4
  • 图片数: 1
  • 建立时间: 2007-04-17
  • 更新时间: 2008-04-12

RSS订阅

Open Toolbar