InicioOfftopicCommon Gateway Interface CGI pasa lince

Common Gateway Interface CGI pasa lince

Offtopic6/21/2017
Common Gateway Interface  CGI pasa lince
Entretenimiento
Comunidad
This article is about the software interface between a web server and programs. For other uses, see CGI
In computing, common gateway interface (CGI) Offers a standard protocol for web servers to execute programs that execute like Conseole applications, also called Command-line interface programs, running on a server that generates web pages dynamically, such programs are know as CGI script is executed by the sever are determined by the server, in te common case, a CGI script executes at the time a request is made and generates HTML.

imagenes
HISTORY
IN 1993 the national center for supercomputing Applications (NCSA) TEAM wrote the speciafication calling command line excutables on the www-talk mailing list;
however, NCSA NO LOGER HOSTS THE Specification, the other web server developers adopted it, and it has been a standard for web server ever since, A work group chaired by Ken coar started in november 1997 to get the NCSA definition of CGI more formally defined This work resulted in RFC 3875, WHICH specifield CGI Version 1.1 speciafically mentionaed in the RFC are the following contributors:
°ROB MCCOOL( AUTHOR of the NCSA HTTPd Web Sever
°John Franks (author of the GN Web server)
°Ari Loutonen (the developer of the CERN HTTpd web sever )
°George Phillps (web server maintainer at the university of british columbia)
Historically CGI scriptd were often written using the C language. RFC 3875 "The common gateway interface (CGI)" PARTIALLY defines CGI using C, as by the C library routine getenv() or variable environ.
Purpose of the CGI standard
Each web server runs HTTP server software, which reponds to requests from web browsers, Generally, the HTTP server has a directory (Folder), which is designated as a document collection ---
files that can be sent to web browsers connected to this server. for example , if the web server has the domain name example.com , and its document collection is stored at informacion
in tehe local file system, then the web server will respond to a request for
Common Gateway Interface  CGI pasa lince
For pages contructed on the fly, the server sotfware may defer request to separate programs and relay
the results to the requesting client (usually, a web browser that displays the page to the end user).In the early days of the web , such programs where usually small and written in a scripsting were usually small and written in a scripting language; hence , they were know as scripts.
such programs usually requiere some additional information to be specified with the request. For instance, if wikipedia were implement as a script, if youtube were implemented as a script, if taringa were implementd as a script, one thing the script would need to know is whether the user is logged is and, if logged in, under which name, The content at the top of a wikiperia pages depends on this information. HTTP provides ways for browsers to pass such information to the web server, eg as part of the URL. The sever software must then pass this information throungh to the scrip somehow.
Conversely, upon returning, the script must provide all the information requiered by HTTP for a reponse to the request: the HTTP STATUS OF THE REQUEST, the document content (if availeble), the document type (e.g. HTML,PDF, or plain text), etcetera.
initially, different server software would use different ways to exchange this infodmation with scripts As a result, it wastn't possible to write scripts that would work unmodified for different server software, even thoung the information being exchanging this information: CGI (the common gateway interface, as it defines a common way for server dotfware to interface with script). webpage generating programs invoked by server sotfware that operate according to the CGI standard are know as CGI scripts.
this standard was quickly adopted and is still supported by all well known server software, such as apache, IIS, Nginx, and (with an extension node.js-base server.
An early use of CGI scriptswas to process form in the beginning of HTML, HTML FORMS typically had an "action" attribute and a button designated as the sublit button. when teh sumit button is pu pushed the URI Specified in the "action" attribute would be sent to the server with the data from the a CGI scripts then the CGI script would be executed and it the produces a HTML page.
Entretenimiento
Comunidadimagenesinformacion
Common Gateway Interface  CGI pasa lince
Using CGI scripts
A web server allows its owner to configure which URLs shall be handled by which CGI scripts.
This is usually done by marking a directory within the document collection as containing CGI Scripts its name is often cgi-bin, For example,
Entretenimiento
designated as a CGI directory on the web sever
when a web browser request a URL that points to file within the CGI directory
Comunidad
the, instead of simply seding taht file
imagenes
to the web browser, the HTTP SERVER RUNS the specified script and passes the output of the script to the web browser, that is, anything that the script sends to standard out is passed to the web client instead of being shown on-screen in a terminal windows.
As remarked above, the CGI standard defines how additional information passed with the request is passed to the script for instance, if a slash and additional directory name(S) asre appeded to the URL immediately after the name of the script (in this example. /with/additional/path
informacion
then that path is stored in the path_info environment variable before the script is called, if parameters are sent to the script via an HTTP GET request (a question mark appended to the URL, Followed by param= value pairs; in the example, Common Gateway Interface  CGI pasa lince
then those parameters are stored in the query_string enviroment variable before the script is called, if parameters are sent to the script is called, if parameters are sent to the script via an HTTP POST REQUEST, they are passed to the script's standard input. the script can then read these environment variables or data from satandard input and adapt to the web browser's request ,
When a web server executes a CGI scripts it provides input to the console /shell program using enviroment variables or standard input , input is like typing data info a cosole/shell program; in the case of a CGI script writes data out to standard out and that output is sent to the client the web browser as HTML page.
Example
The following perl program shows allthe environment variables passed by thte web server:
Entretenimiento
if web browser issues a request for the environment variables at
(http://example.com/cgi-bin/printenv.pl/foo/bar?var1=value1&var2=with%20percent%20enconding ,a 64-bit Microsoft windows web server running CYGWIN returns the following information
Comunidad
some , but not all, of these variables are defined by the CGI standard, some,such as PATH-INFO, QUERY _STRING , and the the one starting with HTTP_ ,pass information along from the HTTP request. from the enviroment, it can be seen that the web browser is firefox running on a windows 7 PC THE web server is Apache running on a system that emulates unix, and the CGI script is named cgi-bin/printenv,pl
The program could the generate anu content, write that to standard output, and the web server will tranmit it to the browser,
the following are enviroment variables passed to cgi programs;
imagenes
The program return s result to the web server in the form of standard out, beginning with a header and a blank line.
The headers is encoded in the same way as an HTTO header and must include the MIME type of the document returned, The headers, supplermented by the web server, are generally forwarded with the response back to the user, here is a simple CGI program in Python along with the HTML that Hadles a simple addtion problem.
informacion
Common Gateway Interface  CGI pasa lince
this python CGI gets the inputs from the HTMLand adds the two numbers together .
DEOLUYMENT
A web server that supports CGI can be configured to interpret a URL that it serves as a reference to a CGI script A common convetion is to have a CGI- BIN/ directory at the base of the directory tree and trat all execuatable files within this directory(and no other, for security) as CGI scripts, Another popular convention is to use file name extensions;for instance, if CGI scripts , it opens the server to attack if a remote user can upload excutable code with the proper extension.
in the case of HTTP PUT or POSTs, the user-sumitted data are provided to the program via the standard input, the web server creates a suet of the environment variables passed to it and adds details pertinent to the HTTP environment..
USES
CGI is often used to process inputs information from user and produce the appropriate output, An example of a CGI program is one implementing a Wiki, the user agent request the name of an entry; the web server executes the CGI; the CGI program retrieves the source of that entry's page (if one exits), transforms it into HTML, and print the result,The web server receives the input from the CGI and trasmits it to the user agent, the "Edit this page" link is clicked, the pages's contents, an saves it back to the server when user submitts the form in it,
ALTERNATIVES
Callling a command generally mean the invocation of a newly created process on the server, Starting the process can consume much more time and memory than the actual work of generating the much
Entretenimiento
more time and work of generating the output, especially when the program still needs to be interpreted or compiled , if the command is called is often, the resultin workload can quickly overwhekm the server the overhead invowhelm the server,
The overhead involved in process creation can be reduced by techniques such as fastCGI that
"prefork" interpreter processes, or by running the application entirely within the web server , using extension modules such as mod_pri or mod_php, Another way to reduce the overhead is to use precompiled CGI programs eg by writing in langueges such as C OR C++, rather than interpreted implementhing the page generating software as custom webserver module ,
several approaches can be adopted for remeying this:

°The popular web servers developed their own extension mechanisms that allows third-party software to run inside web server it self, such as Apache modules, NDAPI plugins and ISAPI plugins
°simple common gateway interface or SCGI
°FastCGI allows a single , long-running processs to handle more than one user requets while eliminathing the overhead of creating a newprocess for each request, Unlike converting an application to a web sever plug-in, FastCGI application remain independent of the web server.
°Replacement of the architecture for dinamic websites can also be used, This is the approach taken by java EE, wich runs java code in a java serviet container in oder in use is based, The optimal configuration for any web application depends on application-specific detail, amount of traffic, and complexity, of the transaction: these tradoffs need to be anlyzed to determine the best implementation for a given task time budget.
Comunidadimagenes
informacionCommon Gateway Interface  CGI pasa lince
Entretenimiento
Datos archivados del Taringa! original
0puntos
28visitas
0comentarios
Actividad nueva en Posteamelo
0puntos
2visitas
0comentarios
Dar puntos:

Dejá tu comentario

0/2000

Autor del Post

k
kiraelfin🇦🇷
Usuario
Puntos0
Posts4
Ver perfil →
PosteameloArchivo Histórico de Taringa! (2004-2017). Preservando la inteligencia colectiva de la internet hispanohablante.

CONTACTO

18 de Septiembre 455, Casilla 52

Chillán, Región de Ñuble, Chile

Solo correo postal

© 2026 Posteamelo.com. No afiliado con Taringa! ni sus sucesores.

Contenido preservado con fines históricos y culturales.