I've had my server running for a week and I still can't get it to serve CGI scripts (HTML pages are fine). I am running Apache 1.3.19 under RedHat Linux 7.1. Whenever I try to access the scripts through my browser, I get the 500 error page. My error_log says something like:
... [error](2) No such file or directory: exec of /path/to/script failed
... [error] [client xx.xx.xxx.xxx] Premature end of script headers: /path/to/script/
I get both lines each time I try to access a script. I've edited my httpd.conf file 'til I'm blue in the face and can't get it to work. I have ScriptAlias defined as well as the <Directory> block for my cgi-bin directory. I made sure to use the ExecCGI directive. I tried commenting and uncommenting the AddHandler but no luck there either. All path info is correct in the calling html pages and cgi scrips. I've tried typing their URLs directly into my browser but get the same result. I'm at the point where I'm going in circles now. I need someone to point my in new directions. By the way all file permissions are correct. I'm starting to thing the first error message is from the scripts themselves. Is it possible that they can't find perl or a perl module they need? I double checked and it is correct in the scripts (#!/usr/bin/perl). If I open a terminal and have perl execute the script from the command line, it just displays the text of the file. This makes me wonder if you can execute cgi locally. I hope someone out there can help me on this. I've even tried reinstalling everything from scratch and that didn't help either. I'm back where I was a week ago. I'd appreciate any help you can give me on this. Thanx
... [error](2) No such file or directory: exec of /path/to/script failed
... [error] [client xx.xx.xxx.xxx] Premature end of script headers: /path/to/script/
I get both lines each time I try to access a script. I've edited my httpd.conf file 'til I'm blue in the face and can't get it to work. I have ScriptAlias defined as well as the <Directory> block for my cgi-bin directory. I made sure to use the ExecCGI directive. I tried commenting and uncommenting the AddHandler but no luck there either. All path info is correct in the calling html pages and cgi scrips. I've tried typing their URLs directly into my browser but get the same result. I'm at the point where I'm going in circles now. I need someone to point my in new directions. By the way all file permissions are correct. I'm starting to thing the first error message is from the scripts themselves. Is it possible that they can't find perl or a perl module they need? I double checked and it is correct in the scripts (#!/usr/bin/perl). If I open a terminal and have perl execute the script from the command line, it just displays the text of the file. This makes me wonder if you can execute cgi locally. I hope someone out there can help me on this. I've even tried reinstalling everything from scratch and that didn't help either. I'm back where I was a week ago. I'd appreciate any help you can give me on this. Thanx