cgi-bin not working

Guust

Verified User
Joined
Jul 10, 2003
Messages
48
cgi-bin is not working on our new server.
I get this error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@***.com 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.


--------------------------------------------------------------------------------

Apache/1.3.29 Server at www.***.com Port 80

What can I do about this? Reinstall cgi-bin? And how?

thanx

Guust Hilte
Safe2Surf
 
Hello,

Check the permissions on everything (755 at most, 777 will not work). Owner also must be the owner of the account.

Check /var/log/httpd/suexec_log for details on the error.

John
 
DirectAdmin Support said:
Hello,

Check the permissions on everything (755 at most, 777 will not work). Owner also must be the owner of the account.

Check /var/log/httpd/suexec_log for details on the error.

John

it's not the permissions, because every account has this on our server. I dubble checked the permissions on every account but cgi bin just doesn't work.
 
Code:
[2004-01-20 16:56:23]: info: (target/actual) uid: (<username>/<username>) gid: (<username>/<username>) cmd: forum.cgi
[2004-01-20 16:56:23]: error: file has no execute permission: (/home/<username>/domains/<username>.nl/public_html/cgi-bin/forum.cgi)

While:

Code:
[root@server cgi-bin]# ls -al
...
-rwxr-xr-x    1 <username> <username>     5547 Jan 18 23:41 forum.cgi
...
-rwxr-xr-x    1 <username> <username>     5089 Jan 21 18:00 guestbook.cgi

And like Guust said, it's not the only user experiencing this error, there are more. Know where to look?
 
Last edited:
Hello,

Also double check the permissions of the cgi-bin directory.

I had a look at the actual suexec.c code, for any programmers, here it is:
PHP:
     /*
     * Error out if the program is not executable for the user.
     * Otherwise, she won't find any error in the logs except for
     * "[error] Premature end of script headers: ..."
     */
    if (!(prg_info.st_mode & S_IXUSR)) {
	log_err("error: file has no execute permission: (%s/%s)\n", cwd, cmd);
	exit(121);
    }
Which does in fact point to the file itself.. so double check the path you're using.

John
 
hmm, we just moved EVERY thing from our old server to the new server and now is cgi not working. Also not working for the new account(that doesn't used the backupfunction). Isn't there a way to reinstall cgi or reconfiger cgi or something? Because I strongly think we just don't even got cgi on our server.
 
Hello,

If the /var/log/httpd/suexec_log is being filled up with data, then you do have cgi's on your server. Just keep an eye on that log, or your domain error logs for possibly reasons why things don't run.

Also, if everything else seems to be working correctly, try running the script from the command prompt, in case there are things that are dying before the script gets a chance to finish (ie: included modules that don't exist:
Code:
cd /home/username/domains/domain.com/public_html/cgi-bin
./script.cgi
Re: Permissions, yes that cgi-bin folder looks correct.

John
 
[root@server cgi-bin]# ./forum.cgi
Can't locate CGI.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0) at ./forum.cgi line 16.
BEGIN failed--compilation aborted at ./forum.cgi line 16.
 
For future reference the fix was:

# perl -MCPAN -e shell
# cpan> install CGI

however, in this case it was the actual CGI and CGI::* modules missing.... there are others but that covers the main cgi.pm problem :)

Chris
 
ProWebUK said:
For future reference the fix was:

# perl -MCPAN -e shell
# cpan> install CGI

however, in this case it was the actual CGI and CGI::* modules missing.... there are others but that covers the main cgi.pm problem :)

Chris

thanx for fixing:D
 
ProWebUK said:
For future reference the fix was:

# perl -MCPAN -e shell
# cpan> install CGI

however, in this case it was the actual CGI and CGI::* modules missing.... there are others but that covers the main cgi.pm problem :)

Chris

I did those two and still it gives me the same error, in the log file:

[2006-01-24 10:36:24]: uid: (500/admin) gid: (500/500) cmd: v.php

without errors?

Peace,
 
Back
Top