本質區別:
1)
apache支持靜態頁面;
tomcat支持動態頁面,比如servlet等。
2)
apache是web(http)服務器,它是專門用于提供HTTP服務,以及相關配置的(例如虛擬主機、URL轉發等等)
tomcat是應用(java)服務器,它只是一個servlet(jsp)容器,可以認為是apache的擴展,但是可以獨立于apache運行。
3)
apache是一輛卡車,上面可以裝一些東西如html等。但是不能裝水,要裝水必須要有容器(桶),而這個桶也可以不放在卡車上。
使用區別:
tomcat 作為 jsp,servlet 容器,雖然有靜態解析功能,但性能上與 apache 相比相差很遠。
apache 可以運行一年不重啟,穩定性非常好,而 tomcat 則不見得。
整合:
一般使用apache+tomcat的話,apache只是作為一個轉發,對jsp的處理是由tomcat來處理的。
整合的好處是:
如果客戶端請求的是靜態頁面,則只需要Apache服務器響應請求,apache 解析 html 等靜態網頁非常快,是經過無數測試證明的。
如果客戶端請求動態頁面,則是Tomcat服務器響應請求。
因為jsp是服務器端解釋代碼的,這樣整合就可以減少Tomcat的服務開銷。
其它:
Tomcat是Apache組織在符合J2EE的JSP、Servlet標準下開發的一個JSP服務器
some official definitions:What is the
Apache HTTP Server?
??? * is a powerful, flexible, HTTP/1.1 compliant web server
??? * implements the latest protocols, including HTTP/1.1 (RFC2616)
??? * is highly configurable and extensible with third-party modules
??? * can be customised by writing 'modules' using the Apache module API
??? * provides full source code and comes with an unrestrictive license
??? * runs on Windows 2003/XP/2000/NT/9x, Netware 5.x and above, OS/2, and most versions of Unix, as well as several other operating systems
What is the
Apache Tomcat?
??? Apache Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
??? Apache Tomcat is developed in an open and participatory environment and released under the Apache Software License.
posted on 2007-03-06 21:00
Jcat 閱讀(818)
評論(0) 編輯 收藏 所屬分類:
Java