Saturday, January 16, 2010

apache 아파치 vs 톰캣 tomcat

왜 tomcat을 apache와 연동하는가?

apache가 web server인 건 알겠고...

tomcat이 먼지를 모르겠는 문제에 부딪히는데...

단순히 3-tier 환경에서 server 에서 하는 일 중 business logic 부분을 따로 떼어왔다는 설명도 있으나...

tomcat 자체가 web container 라느니... WAS 라느니... 라는 얘기가 있어서...

좀 정리해 보기로 한다.

container? WAS?

apache는 web server이다. -> web server는 http 환경에서 html 문서 처리를 해준다.

하지만 이러한 html은 프로그램과 달리 static contents라는 한계를 가지고 있다.

이에 따라 web환경에서 web contents를 dynamically 처리할 수 있는 java applet이나 servlet 등이 나타났다.

static html만 처리한다면 web server가 빠르지만, security 등의 여러 이유들이 나타나며 web 환경이 동적으로 변화하도록 이끌었다.

dynamic contents는 servlet이나 JSP 등으로 표현되었고 이렇게 표현된 request는 Web Container를 따로 두어 처리하도록 하였다.

 If an HTTP Request refers to a Web Component (typically a Servlet or a JSP) then the request is forwarded to the Web Container and the result of the request is sent back to Web Server, which uses that result to prepare the HTTP Response for the particular HTTP Request.

 위 두 가지의 통합 [ web server + web container ] == (web) application server  이다. (was)


즉, WAS는 web container를 포함하는 개념이었던 것인가??

tomcat이 apache 없이 단독으로 쓰일 때는 WAS로써 쓰는 것이고,

apache와 연동할 때는 tomcat을 web container로써 쓰고 apache를 web server로써 쓰는 것인가?


tomcat은 java(j2ee)를 위한 application server이고,

이 분류엔 WebSphere(IBM), WebLogic (Oracle), JBoss (Red Hat) 등도 있고,

PHP를 위해서는 Zend가 있고,

Microsoft 에서는 web container의 구분을 명확히 하지 않고,  .NET Framework (ADO.NET, ASP.NET) 안에서 기능을 제공한다고 한다.

No comments:

Post a Comment