CGI

CGI

HashFlare
Typical Use case:
  1. mobile application scan and login on webpages, when request for a qrcode, the request normally a cgi request
  2. Server Management portal or proxy, you can control server and invoke some cmd on the webpage
Web application evolve

–> server-side scripting(some kind of CGI-script) (NOW modern fastcgi)

–> server-sider include (asp, php)
–> ajax(don’t need to refresh, but have to add api call,in a ‘pull’ fasion)
–> socket(html5 push)

Web Evolution: from CGI to Websockets (and how it will help you better monitor your cloud infrastructure)

Basic Q&A:

A&Q http://www.htmlhelp.org/faq/cgifaq.1.html
1.5: Should I use CGI or SSI or … { PHP/ASP/… }

CGI and SSI (Server-Side Includes) are often interchangable, and it may
be no more than a matter of personal preference. Here are a few
guidelines:
1) CGI is a common standard agreed and supported by all major HTTPDs.
SSI is NOT a common standard, but an innovation of NCSA’s HTTPD
which has been widely adopted in later servers. CGI has the
greatest portability, if this is an issue.
2) If your requirement is sufficiently simple that it can be done
by SSI without invoking an exec, then SSI will probably be
more efficient. A typical application would be to include
sitewide ‘house styles’, such as toolbars, netscapeised <body>
tags or embedded CSS stylesheets.
3) For more complex applications – like processing a form –
where you need to exec (run) a program in any case, CGI
is usually the best choice.
4) If your transaction returns a response that is not an HTML page,
SSI is not an option at all.

Many more recent variants on the theme of SSI are now available.
Probably the best-known are PHP which embeds server-side scripting
in a pre-html page, and ASP which is Microsoft’s version of a
similar interface.
1.6: Should I use CGI or an API?

APIs are proprietary programming interfaces supported by particular
platforms. By using an API, you lose all portability. If you know
your application will only ever run on one platform (OS and HTTPD),
and it has a suitable API, go ahead and use it. Otherwise stick to CGI.

More Comparison:

What is Common Gateway Interface (CGI)? https://stackoverflow.com/questions/2089271/what-is-common-gateway-interface-cgi

ASP.NET–What is ISAPI ?/What is CGI?/ Advantage Of ISAPI Over CGI
ASP.NET–What is ISAPI ?/What is CGI?/ Advantage Of ISAPI Over CGI

CGI programs are the most common way for Web servers to interact dynamically with users. Many HTML pages that contain forms, for example, use a CGI program to process the form’s data once it’s submitted. Another increasingly common way to provide dynamic feedback for Web users is to include scripts or programs that run on the user’s machine rather than the Web server. These programs can be Java applets, Java scripts, or ActiveX controls. These technologies are known collectively as client-side solutions, while the use of CGI is a server-side solution because the processing occurs on the Web server.
With CGI, the system creates a unique process for every request. Each time an HTTP server receives a request, it initiates a new process. Because the operating system must maintain all these processes, CGI requires many of resources. This inherent limitation makes it difficult to develop responsive Internet applications with CGI.

With ISAPI, requests do not require a separate process. Threads are used to isolate and synchronize work items, resulting in a more efficient use of system resources.

php mode selction
default mode: php_mod
http://shackleford.me/wiki/index.php/Apache2

友荐云推荐