When you're working with CGI scripts, certain messages can quickly become extremely familiar and tiresome; typically the output in the browser window will be either a blank page or an Internal Server Error page.
This message has several different possible causes. These include, but are not necessarily limited to:
To test to see if the problem is an error condition or improper CGI response formatting, run the script interactively from the command line to verify that it is emitting content in compliance with the CGI rules.
If you're using suexec, check the suexec logfile to see if there are security constraints being violated.
You can tell if you're using suexec with the following command:
% httpd -l Compiled-in modules: http_core.c mod_so.c suexec: disabled; invalid wrapper /var/www/apache/bin/suexec
If you get a message that says that suexec is disabled, you can ignore that as a possible cause of the script's execution problems.
If suexec is enabled, though, you should look at its logfile to get more details about the problem. You can find the logfile with:
# suexec -V -D DOC_ROOT="/usr/local/apache/htdocs" -D GID_MIN=100 -D HTTPD_USER="www" -D LOG_EXEC="/usr/local/apache/logs/suexec.log" -D SAFE_PATH="/usr/local/bin:/usr/bin:/bin" -D UID_MIN=100 -D USERDIR_SUFFIX="public_html"
The important line is -D LOG_EXEC="/usr/local/apache/logs/suexec.log"; it tells you exactly where suexec is recording its errors.
You can find out more about CGI and suexec here: