
Pages:<< prev 1 next >>



Fledgling

GroupMembers
Posts34
JoinedMay 13, 2002
Not sure if anyone can help me out on this but here goes anyways.
I have a linux box which runs my afkmud, plus I have apache setup mainly for learning experience and to work on webpages without sending them to my isp constantly to see how they look. My problem is, CGI scripts are giving me problems.
I can write a simple script which will display Hello World and such to a web browser just fine. Making sure to have it print content-type text/html on the first line and such. Here's the problem though. If I download a script from the net say for ad banners or gif rotation, it bugs out with internal server errors. The error_log file from apache says premature end of script header...no such file or directory. I have the pointer to perl correct and checked through the code for directory errors.
I triple checked my file permissions chmod 755 for scripts in the cgi-bin directory.
Also, if I try to execute the script from the linux prompt, I get bad interpreter....no such file or directory.
Any comments, pointers into a specific direction to look at would greatly be appreciated.
I have a linux box which runs my afkmud, plus I have apache setup mainly for learning experience and to work on webpages without sending them to my isp constantly to see how they look. My problem is, CGI scripts are giving me problems.
I can write a simple script which will display Hello World and such to a web browser just fine. Making sure to have it print content-type text/html on the first line and such. Here's the problem though. If I download a script from the net say for ad banners or gif rotation, it bugs out with internal server errors. The error_log file from apache says premature end of script header...no such file or directory. I have the pointer to perl correct and checked through the code for directory errors.
I triple checked my file permissions chmod 755 for scripts in the cgi-bin directory.
Also, if I try to execute the script from the linux prompt, I get bad interpreter....no such file or directory.
Any comments, pointers into a specific direction to look at would greatly be appreciated.


Also, if I try to execute the script from the linux prompt, I get bad interpreter....no such file or directory.
Any comments, pointers into a specific direction to look at would greatly be appreciated.
Okay if its saying that sorta thing from the command line, it rekons it definately can't find the Perl command.
One test would be to run the script using "perl script.pl" or whatever, and see if that runs.. if that doesn't then there is a fault with the script possibly (or its looking for something in the middled of execution that is causing this). If using "perl script.pl" works, then use "which perl" to give you the path to the Perl its using, and use that in the top of the script (I actually have 3 versions installed on mine so it is sometimes possible to have the wrong one )
Once you have it working on the command line, then worry about the apache execution, as the error via apache you are getting if the "bad interpreter" message going out before the Content-type header which is an error. Due to this fact, once the command line is alright, you'll prolly find it'll work via Apache (unless you are using mod_perl which has other dependancies, but thats a totally different matter )



Fledgling

GroupMembers
Posts34
JoinedMay 13, 2002
Thanks. I'll give that a shot and see what happens.



Magician

GroupMembers
Posts122
JoinedMay 1, 2002
nod
check to make sure that the script is seeing perl
also try setting it to 777
if it works - then set it to 775
and work down from there
sure 755 is about as secure as it will be for general cgi scripts, but 775 is also gonna be pretty good.
make sure in your httpd.conf that you are correctly allowing the use of cgi scripts. and that you have allowed the .cgi & .pl extensions .
those are a few of the nasties that I ran it to.
Kilroy
check to make sure that the script is seeing perl
also try setting it to 777
if it works - then set it to 775
and work down from there
sure 755 is about as secure as it will be for general cgi scripts, but 775 is also gonna be pretty good.
make sure in your httpd.conf that you are correctly allowing the use of cgi scripts. and that you have allowed the .cgi & .pl extensions .
those are a few of the nasties that I ran it to.
Kilroy



Fledgling

GroupMembers
Posts34
JoinedMay 13, 2002
well, I've tried almost everything. I've doule checked my httpd.conf. I have options ExecCGI set under the cgi directory, addhandler for cgi is .cgi .pl. The path to perl in the script is pointing to the correct directory. I've tried chmod 700 755 750 777. Tried executing the script from the linux box using perl script.cgi. It seems to work fine that way. I get promted with comman line mode use name=value pairs. I can send my httpd.conf if anyone cares to check it over. One last thing, I am using mod perl, I'll try disabling it in the conf and restarting httpd and see if it lets me that way.



Fledgling

GroupMembers
Posts34
JoinedMay 13, 2002
OK! Mod_Perl must be one heck of a pain in the but to make work! Anyways, I commented out the mod_perl sections of my httpd.conf, and walla. it works!!!!! Thanks for all your help.
Pages:<< prev 1 next >>