Mailing List Archive

~user/cgi_bin script config problem - approx 20k attached
httpd -v output:

Server version: Apache/1.3.19 (Unix) (SuSE/Linux)
Server built: May 14 2001 15:46:52

I am attempting to configure apache 1.3.19 (suse 7.2 distribution) to enable
user cgi-bin scripting by enabling ExecCGI for directory
/home/username/public_html/cgi-bin
But with no luck.
Attached are compressed versions of httpd.conf, together with the inclusion
for public_html/cgi-bin execution.
I have tested the script by putting into the ScriptAlias directory
for /cgi-bin/ and the script worked fine.

the error message in error_log is:

[Fri Feb 1 16:32:08 2002] [error] [client 127.0.0.2] Premature end of script
headers: /home/mrostron/public_html/cgi-bin/test.cgi

The entry in access_log is:

127.0.0.2 - - [01/Feb/2002:16:32:08 -0800] "GET /~mrostron/cgi-bin/test.cgi
HTTP/1.1" 500 606

Thanks for your time on this...
mr

---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: ~user/cgi_bin script config problem - approx 20k attached [ In reply to ]
> From: mark rostron [mailto:mrostron@real.com]

> httpd -v output:
>
> Server version: Apache/1.3.19 (Unix) (SuSE/Linux)
> Server built: May 14 2001 15:46:52
>
> I am attempting to configure apache 1.3.19 (suse 7.2
> distribution) to enable
> user cgi-bin scripting by enabling ExecCGI for directory
> /home/username/public_html/cgi-bin
> But with no luck.
> Attached are compressed versions of httpd.conf, together with the
> inclusion
> for public_html/cgi-bin execution.

Luckily you failed to attach them. Please don't send big attachments unless
it is really necessary.

> I have tested the script by putting into the ScriptAlias directory
> for /cgi-bin/ and the script worked fine.
>
> the error message in error_log is:
>
> [Fri Feb 1 16:32:08 2002] [error] [client 127.0.0.2] Premature
> end of script
> headers: /home/mrostron/public_html/cgi-bin/test.cgi

This means there is something wrong with the cgi script:
http://httpd.apache.org/docs/misc/FAQ.html#premature-script-headers

One thing to check is to look for an suexec log file if you are using suexec
(httpd -l will tell you).

Beyond that, you basically just have a broken cgi script. Try running it
from the command prompt.

Joshua.


---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: ~user/cgi_bin script config problem - approx 20k attached [ In reply to ]
yeah - changed my mind about the attachments.
Anyway, I checked the script and it appears to be working from command-line
and also if I copy the test script into /usr/local/httpd/cgi-bin (ScriptAlias
definition).
There is something in the way I'm configuring the public-html/cgi-bin
directory.
Below is the text of the stanza defining configuration for public_html:

<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

<Directory /home/*/public_html/cgi-bin>
Options +ExecCGI +Indexes
</Directory>

Can you spot anything from this?




On Friday 01 February 2002 16:46, Joshua Slive wrote:
> > From: mark rostron [mailto:mrostron@real.com]
> >
> > httpd -v output:
> >
> > Server version: Apache/1.3.19 (Unix) (SuSE/Linux)
> > Server built: May 14 2001 15:46:52
> >
> > I am attempting to configure apache 1.3.19 (suse 7.2
> > distribution) to enable
> > user cgi-bin scripting by enabling ExecCGI for directory
> > /home/username/public_html/cgi-bin
> > But with no luck.
> > Attached are compressed versions of httpd.conf, together with the
> > inclusion
> > for public_html/cgi-bin execution.
>
> Luckily you failed to attach them. Please don't send big attachments
> unless it is really necessary.
>
> > I have tested the script by putting into the ScriptAlias directory
> > for /cgi-bin/ and the script worked fine.
> >
> > the error message in error_log is:
> >
> > [Fri Feb 1 16:32:08 2002] [error] [client 127.0.0.2] Premature
> > end of script
> > headers: /home/mrostron/public_html/cgi-bin/test.cgi
>
> This means there is something wrong with the cgi script:
> http://httpd.apache.org/docs/misc/FAQ.html#premature-script-headers
>
> One thing to check is to look for an suexec log file if you are using
> suexec (httpd -l will tell you).
>
> Beyond that, you basically just have a broken cgi script. Try running it
> from the command prompt.
>
> Joshua.
>
>
> ---------------------------------------------------------------------
> 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@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

--
as you were ...
rostron out

---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: ~user/cgi_bin script config problem - approx 20k attached [ In reply to ]
> From: mark rostron [mailto:mrostron@real.com]

> yeah - changed my mind about the attachments.
> Anyway, I checked the script and it appears to be working from
> command-line
> and also if I copy the test script into /usr/local/httpd/cgi-bin
> (ScriptAlias
> definition).
> There is something in the way I'm configuring the public-html/cgi-bin
> directory.
> Below is the text of the stanza defining configuration for public_html:

How come everybody is only reading half my posts today? If it works in the
main cgi-bin, but you get "premature end of script headers" elsewhere, then
the most likely answer is suexec. Check to see if you are using it, and
check the contents of the suexec log file.

The fact that you get "premature end of script headers" means that the
apache configuration is fine: it is trying to launch your cgi script. The
lanuch is failing, either because there is something wrong with the script,
or an intermediary (suexec) is failing.

Joshua.


---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: ~user/cgi_bin script config problem - THANKS! [ In reply to ]
Thanks for your help on this.
Looked into the suexec.log and found that the cgi-bin directory and any cgi
files in it were failing because they were 777 permissions, which the server
did not allow.

On Friday 01 February 2002 17:38, Joshua Slive wrote:
> > From: mark rostron [mailto:mrostron@real.com]
> >
> > yeah - changed my mind about the attachments.
> > Anyway, I checked the script and it appears to be working from
> > command-line
> > and also if I copy the test script into /usr/local/httpd/cgi-bin
> > (ScriptAlias
> > definition).
> > There is something in the way I'm configuring the public-html/cgi-bin
> > directory.
> > Below is the text of the stanza defining configuration for public_html:
>
> How come everybody is only reading half my posts today? If it works in the
> main cgi-bin, but you get "premature end of script headers" elsewhere, then
> the most likely answer is suexec. Check to see if you are using it, and
> check the contents of the suexec log file.
>
> The fact that you get "premature end of script headers" means that the
> apache configuration is fine: it is trying to launch your cgi script. The
> lanuch is failing, either because there is something wrong with the script,
> or an intermediary (suexec) is failing.
>
> Joshua.
>
>
> ---------------------------------------------------------------------
> 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@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

--
as you were ...
rostron out

---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org