Current apache2 conf load mod_cgi module, whereas documentation advises to use mod_cgid on Unix platform. They only talk of performance issues, but i was unable to run some CGI script with long output using mod_cgi.
Just commenting LoadModule statement for mod_cgi and uncommenting LoadModule statement for mod_cgid in httpd2.conf, and setting Scriptsock statement to /var/run/cgid.sock in commonhttpd.conf was sufficient to switch. -- Any cool program always requires more memory than you have. -- Murphy's Computer Laws n°2