May 31, 2019

What is CGI and CGI program


CGI(Common Gateway Interface)

A standard (technology) for dynamically sending and receiving data between "Web server ↔ CGI programs".
"웹 서버 ↔ CGI 프로그램" 간 데이터를 동적으로 주고받기 위한 표준(기술).

CGI program = web application
The CGI applied program that running on the server.
It can be implemented in various server-side languages such as ASP, PHP, JSP, and Perl.
It serves to provide a dynamic page to the client(browser).

CGI 프로그램 = 웹 애플리케이션
서버에서 실행되는, CGI가 적용된 프로그램.
ASP, PHP, JSP, Perl 등 다양한 서버 측 언어로 구현이 가능하다.
클라이언트(브라우저)의 요청에 동적 페이지를 제공하는 역할을 한다.

dynamic page
Pages that are provided to clients by creating a web page(HTML file) in real time considering the situation, even when requested to the same web page.

동적 페이지.
동일한 웹 페이지에 접속하더라도, 상황을 고려하여 실시간으로 웹 페이지(HTML 파일)를 만들어 클라이언트에게 제공되는 페이지.

Database browsing, login, etc. can be implemented by dynamic pages.

데이터베이스 열람, 로그인 등은 동적 페이지에 의해 구현이 가능하다.

More specifically, the CGI program is run by the Web Application Server(WAS), not the Web server.

보다 세부적으로 말하자면, CGI 프로그램은 웹 서버(Web Server)가 아니라 WAS(Web Application Server)에 의해 실행된다.

When a client makes a request, at first, web server checks its contents. If the requested data is a static page, it is handled directly, but if it is a dynamic page, the request is handed to WAS. At this point, WAS runs the CGI program and passes the results to the web server.

클라이언트의 요청이 있을 경우, 최초 웹 서버가 그 내용을 확인한다. 요청한 자료가 정적 페이지라면 직접 처리하지만, 동적 페이지라면 WAS에게 처리하도록 요청을 넘긴다. 이때 WAS는 CGI 프로그램을 실행하며, 그 결과는 웹 서버로 넘긴다.