Bug#444048: similar behaviour observed and solved
I've had the same behaviour originally described by Nick Price, but with
version 2.2.9-10+lenny1 of apache2-mpm-prefork.
Investigation showed the problem only occurs when mod_log_sql is loaded into
Apache. At this point I did a "dpkg --get-selections | grep apache" which
Removing libapache2-mod-log-sql-dbi resolved the issue and CGI scripts
started working again.
I would like to ask others who have been getting the "premature end of
script headers" error with the apache-2.2.x in lenny to check their SQL
logging modules and report back.
I hope this helps,
ps. Merry Christmas!