Pacific-Design.com

    
Home Index

1. Linux

2. FastCGI

+ C++

+ C Language

+ Perl

+ lighttpd

Linux / FastCGI /

FastCGI

http://www.fastcgi.com/
FastCGI is simple because it is actually CGI with only a few extensions. Like CGI, FastCGI is also language-independent. For instance, FastCGI provides a way to improve the performance of the thousands of Perl applications that have been written for the Web.
# Apache2 FastCGI
apt-get install libapache2-mod-fastcgi libfcgi-dev

Perl FastCGI

# Install FastCGI for Perl
cpan[1]> install FCGI

Perl test FastCGI script - env.fcgi

env.fcgi
#!/usr/bin/perl
#--------------------------------------------------------------------#
#   Web interface implemented using FastCGI
#--------------------------------------------------------------------#
use strict;
use FCGI;
use CGI::Fast;
$| = 1;
my $counter=0;
#--------------------------------------------------------------------#
while (my $q=new CGI::Fast)
{
    print $q->header();
    my $value = $q->param('q');
    print 'Request No = ' . ++$counter . ' - ';
    print 'Param q = ' . $value . "<hr align=left width=640>\n";
    foreach my $key (sort keys(%ENV)) {
      print "<b>$key</b> = $ENV{$key}<br>";
    }
}
#--------------------------------------------------------------------#

__END__