RE: Mysterious \"Premature end of script headers\" error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: uxwrstre@xxxxxxxxxxxxx [mailto:uxwrstre@xxxxxxxxxxxxx] 
> Sent: Friday, December 01, 2006 3:32 PM
> To: users@xxxxxxxxxxxxxxxx
> Subject: Re:  Mysterious \"Premature end of 
> script headers\" error
> 
> It's a cgi-bin program written in C.
> I saw that httpd was running as http user and the cgi-bin 
> file belongs to a 
> web user. So I changed the owner of this http-goto file to 
> http user, but I 
> still get the error 500 with this error message.

That's not what I suggested - the owner doesn't matter. It's the
permissions of the user who invokes the program that counts. For
example, if apache runs as user "web" and if the script writes to a file
owned by user "fred", then it'll work when fred runs it but won't work
when called by apache (that would be like web trying to write on files
owned by fred).

To check, change the apache user to be the same as the user you login as
when the thing works.

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

> 
> Now I show you how I execute it in the console:
> acwebint 14:22 archive/docs/bin : cat /tmp/testrc 
> #!/bin/tcsh
> setenv GATEWAY_INTERFACE 'CGI/1.1'
> setenv QUERY_STRING 'tools=%2FDICB&x=8&y=3'
> setenv REMOTE_ADDR '127.0.0.1'
> setenv REMOTE_HOST 'acmp5.hq.lan'
> setenv REQUEST_METHOD 'GET'
> setenv SCRIPT_NAME '/bin/http-goto2'
> setenv SERVER_NAME 'acwebint.lan'
> setenv SERVER_PORT '80'
> setenv SERVER_PROTOCOL 'HTTP/1.1'
> setenv SERVER_SOFTWARE 'Apache/1.3.37 (Unix) mod_jk/1.2.0 
> mod_perl/1.29 
> PHP/4.3.0 mod_ssl/2.8.28 OpenSSL/0.9.8'
> acwebint 14:22 archive/docs/bin : source /tmp/testrc 
> acwebint 14:23 archive/docs/bin : ./http-goto
> Location: http://acwebint/DICB
> 
> acwebint 14:23 archive/docs/bin : 
> ...
> $ tail -f errors
> [Fri Dec  1 14:23:37 2006] [error] [client 127.0.0.1] 
> Premature end of script 
> headers: /home/web/archive/docs/bin/http-goto
> 
> -- 
> Best regards,
> saf
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP 
> Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>
 
 
This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux