cgi-bin -error 500

locateMe

Verified User
Joined
Feb 12, 2004
Messages
44
I hope someone can help me :)

I have a uploaded a web site and it is working just fine - however I have now installed a bulletin board (YaBB) into the cgi-bin but every time I try and run it I get a Server Error 500.

I then tried to upload just a simple gif which displays perfectly ok at the root of the web site but as soon as I put it into the cgi-bin and view it in the browser I get the same Server Error 500.

This happens for any file type that is put into cgi-bin - html, gif, jpg and .pl files all return Server Error 500

So methinks it's something to do with the file permissions but I have tried all combinations from 755 to 777 with the same results.

Any ideas?

Thanks

Steve
 
Problem solved

OK, just solved my own problem

It appears that if any files or folders under cgi-bin have a permission of > 755 then it stops the whole folder from working.

Would be nice if a friendly error message was displayed LOL

Steve
 
Hello,

Yes, suexec has the most cryptic errors. The "friendly" error would be located in /var/log/httpd/suexec_log .. but you may, or may not have access to that.

John
 
Okay, 500 error here too, /var/log/httpd/suexec_log:
Code:
[2004-03-07 04:01:59]: info: (target/actual) uid: (admin/admin) gid: (admin/admin) cmd: coranto.cgi

Code:
[root@server1 testing]# perl -c coranto.cgi
coranto.cgi syntax OK
 
this shows in the httpd error_log:
Code:
[Sun Mar  7 13:35:11 2004] [error] [client 12.108.101.87] Premature end of script headers: /....../coranto.cgi
But the header is obviously being outputted:
Code:
[root@server1 testing]# perl coranto.cgi
Content-type: text/html
Expires: Sun, 07 Mar 2004 18:41:26 GMT


        <html><head><title>[..]
Any ideas?
 
What about:

./coranto.cgi

(intstead of shoving it through perl yourself, let the first line figure it out)..so just double check the interpreter. Other than that, just check the permissions on the file.. not too sure.

John
 
[root@server1 test]# ./coranto.cgi
: bad interpreter: No such file or directory
 
If that's a new FreeBSD system, you may need to link /usr/bin/perl to /usr/local/bin/perl

Code:
use.perl port
OR
Code:
ln -s /usr/local/bin/perl /usr/bin/perl

John
 
It's a redhat 9 box. Should I still set up that slink?

The other thing, apparently this Perl file is in [dos] format, could that be doing it?
 
If /usr/sbin/perl exists as a binary, then it should be fine as is.. and yes, if the files are dos, it would be worth just editing the first line the file to use \n instead of \r\n .. might be causing your grief.. I know I had to change that exact same thing in the skins scripting system for that reason. (accomodates both now)

John
 
Ahh.. hmm - The *same exact* setup is working fine in a subdirectory of public_html, but is not working in public_html:
[2004-03-28 21:01:23]: error: target uid/gid (500/500) mismatch with directory (500/0) or program (500/500)
Any ideas?
 
Back
Top