Internal server error (Premature end of cgi script)
I'm running centos, apache 2.2 with cgi script .Server has been fine for months, and all of a sudden today 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@usershare.net 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/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.9 Server at usershare.net Port 80 Nothing changed, unless I was hacked which I doubt.My error logs say, Fri Aug 21 13:04:35 2009] [error] [client 190.108.166.58] Premature end of script headers: index.cgi I recompiled apache but nothing! I'm lost, can any one help me fix this issue plz. Thank you |
please use useful and informative thread titles and not use words like "urgent" which are usually seen as rude within a voluntary community.
|
Do you have backups of index.cgi? It sounds like it may have been modified (and broken).
------- Side note: Please do not use thread titles like "urgent help please". That has nothing to do with your problem. |
sorry @ mod, didnt mean to come off as "rude"....., anomie I didnt do backups, the script main files don't change I even copied over a fresh index.cgi
|
Any form of developer/sysadmin change logs or (even better) a HIDS would be very helpful in troubleshooting this problem. Without knowing what someone may have recently changed, it's going to require digging.
Failing all of the above, what does # apachectl -t say at this point? What other information is available in your access logs and error logs? |
The command says :-bash: apachectl: command not found
|
as for my logs , thats all thats filled up in there : [error] [client 190.108.166.58] Premature end of script headers: index.cgi, referer:
|
I am the only one that had password to the server, and I am 99% sure no one changed anything
|
post a copy of your index.cgi so we can take a look
|
[code]
#!/usr/local/bin/perl ### ### use strict; use CGI::Carp qw(fatalsToBrowser); use lib '.'; use XFileConfig; use Session; $c->{ip_not_allowed}=~s/\./\\./g; if($c->{ip_not_allowed} && $ENV{REMOTE_ADDR}=~/$c->{ip_not_allowed}/) { print"Content-type:text/html\n\n"; print"Your IP was banned by administrator"; exit; } my $ses = Session->new(); my $f = $ses->f; my $db= $ses->db; my $op = $f->{op}; &CheckAuth() unless $op eq 'login'; if($ENV{HTTP_CGI_AUTHORIZATION} && $ENV{HTTP_CGI_AUTHORIZATION} =~ s/basic\s+//i) { &Login(undef,'instant'); print($ses->{cgi_query}->header(-status=>403)),exit unless $ses->{user}; } |
when I run #perl index.cgi it works.but it wont load in browser
|
Quote:
Code:
su - |
what does the command do really?
I logged in as root via ssh. Doest work. |
This is a basic test that you should be aware of going forward. It performs a syntax check on httpd.conf (and any configuration files it includes).
Working example: Code:
# apachectl -t Code:
# apachectl -t |
lol.. apachectl not found... ouch.
|
All times are GMT -5. The time now is 01:30 PM. |