CGI


 

CGI stands for Common Gateway Interface and it is a standardized mechanism to call scripts from the server.

The term script is abused: it stands for interpreted languages macros as well for high level language compiled executables.

hserv offers a quite complete interface to CGI/1.0.

Script types are restricted to:

The concept of nph script is not supported by hserv.

 


 

The type of the macro is parsed from its file name extension:

The type of a macro may be overwritten with an entry in Handlers file.

The Handlers file consists of lines in the form
<pattern> <handler>

pattern An AmigaDOS pattern applied to the requested script.
handler One of:
  • REXX: consider the script an ARexx macro
  • REBOL: consider the script a REBOL script
  • PERL: consider the script a PERL macro
  • EXE: consider the script a compiled executable
  • SEND: just send the script as application/octet

 


 

A CGI will be execute if and only if the option DISABLECGI is not set.

A Perl script will be execute if and only if the option PERLPATH is defined and its value is a complete path to perl or sh or whatever.

A Rebol script will be execute if and only if the option REBOLPATH is defined and its value is a complete path to Rebol.

 


 

CGI scripts derive arguments in this way:

The avaible arguments are:

ARexx, Perl and AmigaOS executable
Rebol

Scripts must write to stdout:

Other non empty lines after Content-Type: mime are discarded.