I wrote my first CGI “program”(Hello World), actually copied it and put it in the cgi-bin directory under my domain; have been trying unsuccessfully to make it work. I’ve run it outside the web server (from the shell) and it seems to be working fine. Here is the log from the shell:
[voss]$ cd cgi-bin
[voss]$ perl -w hello.pl
Then, I’ve made the program readable and executable (chmod a+rx ./hello.pl)
I’ve tried to run it from http://mydomain/cgi-bin/hello.pl and have encountered a problem:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, firstname.lastname@example.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I’ve checked the server error log and it shows:
[Wed Mar 21 18:07:16 2007] [error] [client my IP] failed to open log file
[Wed Mar 21 18:07:16 2007] [error] [client my IP] fopen: Permission denied
[Wed Mar 21 18:07:16 2007] [error] [client my IP] Premature end of script headers: hello.pl
[Wed Mar 21 18:07:16 2007] [error] [client my IP] File does not exist: /home/username/mydomain.com/internal_error.html
[Wed Mar 21 18:07:17 2007] [error] [client my IP] File does not exist: /home/username/mydomain.com/favicon.ico
[Wed Mar 21 18:07:17 2007] [error] [client my IP] File does not exist: /home/username/mydomain.com/missing.html
I have no clue what should be done next. Could anyone help me?