Web Hosting Talk







View Full Version : 500 error in CGI-BIN Directory....very strange


WebmastTroy
06-09-2002, 09:11 PM
Ok....scenario:

test.pl script:


#!/usr/bin/perl

print "Content-type: text/html\n\n";

print "Hello";


I upload that in my public_html folder, change permissions....it works.

I upload that in my cgi-bin folder, change permissions....it works

I upload that into my clients public_html folder, change permissions....it works.

I upload that into my clients cgi-bin folder, change permissions....it DOESN'T work.

The error log show premature end of script headers. Now, it gets even more strange....all 4 of those scripts work via shell, even client's version of test.pl in the cgi-bin.

Frontpage extensions are installed on this client's account, but the cgi-bin directory works on another account that has frontpage on it, so I'm not sure what the problem is. I run a CPanel/WHM server, if that makes a difference.

Oh, and I've also tried the FIX INSECURE PERMISSIONS in WHM, and it still won't work.

Anyone have ANY ideas?

All help is appreciated!

Thanks.

Cephren
06-09-2002, 09:53 PM
hmm try adding the -- after the first line.

#!/usr/bin/perl --

sure is strange though.
But then again, you can always go into your httpd.conf and take a look if the clients folder of that particular site is aliased correctly for executing scripts, or see if it is even there.

Techark
06-09-2002, 09:56 PM
the httpd:conf is not aliased correctly for that domain or that there is a htaccess file somewhere in the cgi folder keeping it form running scripts.

WebmastTroy
06-09-2002, 10:06 PM
There was a .htaccess file in there that I put in there to try and get it to work. It had "AddHandler cgi-script .cgi .pl" in it to try and get .cgi to be recognized. I did remove it and it still doesn't work.

I also checked out the httpd.conf file and it seems to be just like all the others.

Any other ideas? or anything really specific that I should be looking for? I had something like this before on this same account. No Perl script would work in ANY folder, but I downloaded all the files, deleted the account, and recreated it, and they work in the public_html folder now.....they just don't in the cgi-bin.

Thanks.

phpjames
06-09-2002, 10:09 PM
Open the file via the command line and save it. Sometimes when transfering the file through FTP it may be sent as binary instead of ASCII. If you still get the errors remove the cgi-bin and see if that works after putting it back. Sometimes Ive seen this problem and removing the folder and then readding it helps.

WebmastTroy
06-09-2002, 10:16 PM
I uploaded it in ASCII mode, and it didn't work. I editted it via command line and saved it, and it didn't work.

I just deleted the entire cgi-bin folder and reuploaded everything, and it STILL doesn't work.

I've been a Perl programmer for about 4 years now, and this is the strangest thing I've ever seen.

phpjames
06-09-2002, 10:23 PM
Troy,
I think this happens sometimes with CPANEL. I would suggest if you are the admin to remove the account and then readd it. It should work then. Let us know.

Noldar
06-10-2002, 09:04 AM
Are you running SuExec? Do the user and group of the script match the user and group of the client?

Richard

mdrussell
06-10-2002, 11:11 AM
Check that group settings are consistent with those of your client.

Also check the perms of the CGI-BIN in question, it's possible they could have got messed up, which would produce those errors if you're using suexec.

Do other scripts run in the CGI-BIN?

priyadi
06-10-2002, 10:06 PM
That's probably caused by suexec, if you are using it. Check the suexec log file for more information. Or, if your suexec doesn't log anything, recompile one from Apache source to use a log file. It is a lot easier for debugging if you have your suexec logs somewhere.