docs.roxen.comView this page in a printer friendly mode
DocsRoxenWebServer 5.1System Developer Manual PikeProgramming Languages
Copyright  2013, Roxen Internet Software
Suggestions, comments & compliments

Pike Script
Pike Processing Instruction
Using In-Line Perl Code
Running Perl Scripts
Supported mod_perl API Methods
What is a CGI Script?
CGI Environment Variables
CGI I/O Via Standard Streams


CGI - the freedom and possibly the shackles of free choice, and how CGI scripts can be put to use in the overall Roxen picture.

CGI, the Common Gateway Interface (for an in-depth, external, non-Roxen-specific reference, see a more official definition of the CGI specifications at, is the age-old standard for making and running portable scripts on practically any web server. Roxen supports CGI via the CGI module.

The two good thing about CGI programming is that it works with any web server and that it allows the programmer full freedom of choice regarding the programming language. Unfortunately these are also the only benefits of CGI. For each request to a CGI script a program has to be run, something rather costly performancewise. CGI is not particularly easy to program; many complexities of web application programming must be handled by the CGI programmer. Nor are the security issues handled for you - it is entirely up to the programmer to take care about those issues herself.

Many of these shortcomings are however handled by languages and programming environments that use CGI to access the web server. With a good library, CGI programming can become easy for the programmer. It is however recommended to check how the library, language or environment handles the security implications of web application programming, and what the programmer needs to worry about.

Roxen makes it possible to integrate CGI programming with RXML. It is possible to embed calls to CGI scripts within RXML pages by using the <cgi/> or <insert/> tags. It is also possible for the RXML parser to post process output from CGI scripts. That way, a CGI script can make use of functionality from roxen modules.

The <cgi/> tag can be used together with the <define> tag to create new RXML tags that are handled via CGI scripts.