"premature ends of script header" when I place a cgi script outside the cgi-bin

stromboli2

Verified User
Joined
Oct 7, 2004
Messages
19
"premature ends of script header" when I place a cgi script outside the cgi-bin

Hi,
people I have a simple problem but I can't figure out the solution
I have some scripts outside the cgi-bin, they are in my homedir, execcgi is enabled for that dir.
the same scripts that work perfectly in the cgi-bin, in my home dir game me "premature ends of script headers".
needless to say that the script is allright.

any ideas of what parameter of configuration i am missing?

cordially,
s.
 
What does the apache error log tell you?

It should have a more verbose entry.

Jeff
 
hi,
there's no other thing in the error_log and i have it in the debug level.

[Fri Oct 22 21:02:05 2004] [error] [client 200.55.66.228] Premature end of script headers: /ho
e/yo/domains/yo.net/public_html/buscador.cgi

it's weird, i don't know what the heck is happening with my apache. i also have that every .htm file should be parsed as an .shtml file and includes are on and it's not working! it's weird because I have the same settings in other server and it works fine.

strom... pretty lost.
 
that error can be caused by permissions, make sure the right owner owns the cgi script and that it is +x (executable)
 
hi,
i solved the problem of the .shtml and .htm not being parsed.to be fair i touched so many things that I don't know how i did it...
back to the script problem, all my .cgi files has 755 permissions and are owned by the appropiatte owner.

.strom
 
is it possible there is an actual error in your script? you try any others in that cgi-bin folder that yuo know that work?
 
hi,
i just did that, others scripts are not working too in the home dir. i'm going to touch a bit httpd.conf to see if it helps...
i don't know what else to to except to check everything again.
strom
 
.cgi scripts will only work in the mapped /cgi-bin folder that is created and setup in httpd.conf for da.
 
hi vandal,

why? i have ExecCGI in the appropiate dir.
what do you have to change to have .cgi working in a another directory that it's not cgi-bin.
i have the same config in another server (not using da) and it works.
cordially,
strom.
 
that should be it, did you check if that script works in /cgi-bin dir?

if not you will have to copy the exectcode da uses from /usr/local/directadmin/data/users/<username>/httpd.conf

check that out and maybe add the appropirate scriptexec in there for the dir you are trying to run the cgi script in.
 
>that should be it, did you check if that >script works in /cgi-bin dir?
yes, it works.

>if not you will have to copy the exectcode >da uses from >/usr/local/directadmin/data/users/<username>/httpd.conf
sorry, i don't understand what you mean.

>check that out and maybe add the >appropirate scriptexec in there for the dir >you are trying to run the cgi script in.
I've already put ExecCGI in the dir I try to execute the scripts.

strom
 
got it! after *HOURS* of thinking that was a problem with apache it was a problem with groups permissions
my user and group was BLA
and the public_html was user BLA grp APACHE
I changed the grp to BLA and 751 de public_html dir and voila!
shit , i can't believe I spent so much time for that. i always thought it was another kind of problem.

thank you to each one of you that answered/read the post! :))

strom
 
tip:

Check the suexec_log when dealing with cgi errors, it'll explain why it'll give the premature end of script headers error in there..

Since the DA apache runs all CGI scripts through suexec there's a very strict set of rules on where, which owner and which permissions on files and directories are allowed before a script is being allowed to run..
 
Back
Top