in reply to How to install CGI in ubuntu machine?
Apache has the error_log file which has specific details of failures. See Ovid's CGI Course from Tutorials->Web Programming, along with the Apache documentation.