[NANOWEB DOCUMENTATION]

NANOWEB, the aEGiS PHP web server

mod_cgi

This module allows nanoweb to execute the appropriate script interpreter for a filename extension, if you set it up coreectly by using the ParseExt directive:
   ParseExt = php CGI /usr/local/bin/php
   ParseExt = cgi CGI /usr/bin/perl -w $FILENAME
   ParseExt = pl  CGI /usr/bin/perl -w $FILENAME
   ParseExt = py  CGI /usr/bin/python $FILENAME
   ParseExt = sh  CGI /bin/sh -c $FILENAME
   ParseExt = js  CGI /usr/bin/js $FILENAME
   ParseExt = awk CGI /usr/bin/gawk -f $FILENAME /dev/null
(these are just some examples, but php and perl are the most commonly used ones)

PHP
<html>
<head><title>php example</title></head>
<body>
  <?php
      echo "<h2>Welcome to my homepage!</h2>";
      include("counter.php");
      echo "You are visitor no $counter_n <br>";
      $f = fopen("counter.php");
      fwrite($f, '<?php $counter_n = ' . $counter_n++ . "; ?>");
      fclose($f);
  ?>
  ...


Perl
#!/usr/bin/perl -wTU
require "cgilib.pl";
ReadParse();

echo "Content-Type: text/html\r\n\r\n";
echo "<html><body>";
...




NANOWEB, the aEGiS PHP web server