You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Simon Dassow <ja...@area319.de> on 2002/11/13 14:05:48 UTC

[users@httpd] Apache2 sends wrong header

Hi all,
i'm currently using apache2 with php, running it as cgi-version thru
suexec.
No problem yet, but when it comes to SSL, i'm getting strange headers.

Example:
--------
0

HTTP/1.1 200 OK
Date: Mon, 11 Nov 2002 11:31:32 GMT
Server: Apache/2.0.43 (Unix) mod_ssl/2.0.43 OpenSSL/0.9.6g
--------

The '0' is the reason why the browser offers the document to be
downloaded.
I dont know what to do... seems that its only happening with php, but
php is sending the headers after that, so there must be something wrong.
But other cgi-scripts (i.e. perl or ruby) are running fine, only with
php i get those strange headers.

Some ideas? (I've posted allready a bugreport to the php developers, but
the say it's a apache-problem (which i really cant believe) here:
http://bugs.php.net/bug.php?id=20356 ).

Thanks and regards,
simon


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


[users@httpd] Apache2 && SSL && keep-alive && chunked == broken? / Submit Bug?

Posted by Simon Dassow <ja...@area319.de>.
Hi All,
Regarding to the preceding discussion if php or apache is generating the
error, we found out that it's apache.
As Rasmus said, the problem occurs only if the response is keep-alive
and chunked.
Now my question if it's a known issue (found nothing on buglist) or
maybe i've done something wrong (three friends are reporting same
problems with slightly different setups).

Best regards,
Simon

On Fri, 2002-11-15 at 09:19, Rasmus Lerdorf wrote:
> In the end this has to be an Apache problem. Perhaps PHP is sending
> something unexpected, but no matter what, since you are running PHP as a
> CGI there is no way that PHP should in any way be able to mess up the
> response headers in the way you are seeing. From what I can see testing
> https://mail.linux-de.org/test/test.php it only happens on a keep-alive
> chunked response. Non-keep-alive, non-chunked responses always work.
> Sometimes on a keep-alive, chunked response the start and end chunk
> headers are around the entire response, including the HTTP headers. This
> is bogus and clear indication of a web server bug.
> 
> -Rasmus
> 
> On 15 Nov 2002, Simon Dassow wrote:
> 
> > So now i've setup a 'test-suite'...
> > HTTP-Version: http://xmail.linux-de.org/test/
> > HTTPS-Version: https://mail.linux-de.org/test/
> >
> > There are php.html, perl.html and ruby.html... all cgi-scripts printing
> > the ENV-Vars in a frameset.
> > PHP will fail nearly every time in one frame at minimum, the others
> > (perl and ruby) work nearly every time correct (it's absolutely
> > acceptable).
> >
> > So now tell me, is it an PHP-Problem or Apache2? (I myself think again
> > it's php).
> >
> > regards,
> > simon
> >
> > On Wed, 2002-11-13 at 19:15, Joshua Slive wrote:
> > >
> > > On Wed, 13 Nov 2002, Simon Dassow wrote:
> > >
> > > > This one: https://mail.linux-de.org/
> > > > If you refresh a few times, you will see it :(
> > >
> > > Interesting.  Very likely it is SSL related.  Can you generate the same
> > > thing on a non-ssl server?
> > >
> > > That's a hard one to debug, because it involves an interaction between
> > > SSL, php, and Apache, and I really couldn't tell you where exactly the bug
> > > is.  You can report it to the apache bug database, but without a simpler
> > > test case (ie, one that doesn't involve php), it will be hard to debug.
> > >
> > > 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
> > >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > > For additional commands, e-mail: users-help@httpd.apache.org
> > >
> >
> >
> 
> 
> ---------------------------------------------------------------------
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


Re: [users@httpd] Apache2 sends wrong header

Posted by Rasmus Lerdorf <ra...@apache.org>.
In the end this has to be an Apache problem. Perhaps PHP is sending
something unexpected, but no matter what, since you are running PHP as a
CGI there is no way that PHP should in any way be able to mess up the
response headers in the way you are seeing. From what I can see testing
https://mail.linux-de.org/test/test.php it only happens on a keep-alive
chunked response. Non-keep-alive, non-chunked responses always work.
Sometimes on a keep-alive, chunked response the start and end chunk
headers are around the entire response, including the HTTP headers. This
is bogus and clear indication of a web server bug.

-Rasmus

On 15 Nov 2002, Simon Dassow wrote:

> So now i've setup a 'test-suite'...
> HTTP-Version: http://xmail.linux-de.org/test/
> HTTPS-Version: https://mail.linux-de.org/test/
>
> There are php.html, perl.html and ruby.html... all cgi-scripts printing
> the ENV-Vars in a frameset.
> PHP will fail nearly every time in one frame at minimum, the others
> (perl and ruby) work nearly every time correct (it's absolutely
> acceptable).
>
> So now tell me, is it an PHP-Problem or Apache2? (I myself think again
> it's php).
>
> regards,
> simon
>
> On Wed, 2002-11-13 at 19:15, Joshua Slive wrote:
> >
> > On Wed, 13 Nov 2002, Simon Dassow wrote:
> >
> > > This one: https://mail.linux-de.org/
> > > If you refresh a few times, you will see it :(
> >
> > Interesting.  Very likely it is SSL related.  Can you generate the same
> > thing on a non-ssl server?
> >
> > That's a hard one to debug, because it involves an interaction between
> > SSL, php, and Apache, and I really couldn't tell you where exactly the bug
> > is.  You can report it to the apache bug database, but without a simpler
> > test case (ie, one that doesn't involve php), it will be hard to debug.
> >
> > 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
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
>
>


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


Re: [users@httpd] Apache2 sends wrong header

Posted by Simon Dassow <ja...@area319.de>.
So now i've setup a 'test-suite'...
HTTP-Version: http://xmail.linux-de.org/test/
HTTPS-Version: https://mail.linux-de.org/test/

There are php.html, perl.html and ruby.html... all cgi-scripts printing
the ENV-Vars in a frameset.
PHP will fail nearly every time in one frame at minimum, the others
(perl and ruby) work nearly every time correct (it's absolutely
acceptable).

So now tell me, is it an PHP-Problem or Apache2? (I myself think again
it's php).

regards,
simon

On Wed, 2002-11-13 at 19:15, Joshua Slive wrote:
> 
> On Wed, 13 Nov 2002, Simon Dassow wrote:
> 
> > This one: https://mail.linux-de.org/
> > If you refresh a few times, you will see it :(
> 
> Interesting.  Very likely it is SSL related.  Can you generate the same
> thing on a non-ssl server?
> 
> That's a hard one to debug, because it involves an interaction between
> SSL, php, and Apache, and I really couldn't tell you where exactly the bug
> is.  You can report it to the apache bug database, but without a simpler
> test case (ie, one that doesn't involve php), it will be hard to debug.
> 
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


Re: [users@httpd] Apache2 sends wrong header

Posted by Simon Dassow <ja...@area319.de>.
Here the same without SSL: http://xmail.linux-de.org ... working
normally.

simon

On Wed, 2002-11-13 at 19:15, Joshua Slive wrote:
> 
> On Wed, 13 Nov 2002, Simon Dassow wrote:
> 
> > This one: https://mail.linux-de.org/
> > If you refresh a few times, you will see it :(
> 
> Interesting.  Very likely it is SSL related.  Can you generate the same
> thing on a non-ssl server?
> 
> That's a hard one to debug, because it involves an interaction between
> SSL, php, and Apache, and I really couldn't tell you where exactly the bug
> is.  You can report it to the apache bug database, but without a simpler
> test case (ie, one that doesn't involve php), it will be hard to debug.
> 
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


Re: [users@httpd] Apache2 sends wrong header

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 13 Nov 2002, Simon Dassow wrote:

> This one: https://mail.linux-de.org/
> If you refresh a few times, you will see it :(

Interesting.  Very likely it is SSL related.  Can you generate the same
thing on a non-ssl server?

That's a hard one to debug, because it involves an interaction between
SSL, php, and Apache, and I really couldn't tell you where exactly the bug
is.  You can report it to the apache bug database, but without a simpler
test case (ie, one that doesn't involve php), it will be hard to debug.

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


Re: [users@httpd] Apache2 sends wrong header

Posted by Simon Dassow <ja...@area319.de>.
This one: https://mail.linux-de.org/
If you refresh a few times, you will see it :(

simon

On Wed, 2002-11-13 at 18:57, Joshua Slive wrote:
> 
> On Wed, 13 Nov 2002, Simon Dassow wrote:
> 
> > No Proxy... all our webmail-user have that problem (only a few people
> > are using it).
> > And i recently checked it with konqueror, same problem.
> > What kind of problem could be that? a memory-leak would affect more than
> > the output i think.
> 
> The problem appears to be that apache is sending chunked-encoding in a way
> that the client does not understand.  Do you have an Internet-accessible
> URL that displays the problem?
> 
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


Re: [users@httpd] Apache2 sends wrong header

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 13 Nov 2002, Simon Dassow wrote:

> No Proxy... all our webmail-user have that problem (only a few people
> are using it).
> And i recently checked it with konqueror, same problem.
> What kind of problem could be that? a memory-leak would affect more than
> the output i think.

The problem appears to be that apache is sending chunked-encoding in a way
that the client does not understand.  Do you have an Internet-accessible
URL that displays the problem?

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


Re: [users@httpd] Apache2 sends wrong header

Posted by Simon Dassow <ja...@area319.de>.
No Proxy... all our webmail-user have that problem (only a few people
are using it).
And i recently checked it with konqueror, same problem.
What kind of problem could be that? a memory-leak would affect more than
the output i think.

regards,
simon

On Wed, 2002-11-13 at 16:54, Joshua Slive wrote:
> 
> On Wed, 13 Nov 2002, Simon Dassow wrote:
> 
> > Currently with Mozilla, but i've checked with IE and Opera and there are
> > the same problems (IE not so often than the both others).
> 
> Is there any kind of proxy server in the way or other complication?
> 
> There certainly may be a bug in apache, but there must be something
> particular about your situation that is triggering it, or we would hear
> many more people complaining.
> 
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


Re: [users@httpd] Apache2 sends wrong header

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 13 Nov 2002, Simon Dassow wrote:

> Currently with Mozilla, but i've checked with IE and Opera and there are
> the same problems (IE not so often than the both others).

Is there any kind of proxy server in the way or other complication?

There certainly may be a bug in apache, but there must be something
particular about your situation that is triggering it, or we would hear
many more people complaining.

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


Re: [users@httpd] Apache2 sends wrong header

Posted by Simon Dassow <ja...@area319.de>.
Currently with Mozilla, but i've checked with IE and Opera and there are
the same problems (IE not so often than the both others).

simon

On Wed, 2002-11-13 at 16:43, Joshua Slive wrote:
> 
> On Wed, 13 Nov 2002, Simon Dassow wrote:
> 
> > Hi again,
> > correction, recently i've got the same for a ruby script...
> >
> > Now i believe that it is a apache-problem.
> > The '0' at the beginning and at the end are strange, also the '9d5'
> > before content.
> > A step closer, but still no clue what it could be.
> 
> This is most likely "chunked encoding".  Do you have some reason to
> believe that Apache shouldn't be sending chunked encoding in this case?
> Are you testing with a real browser, or is this perhaps a home-grown
> script that doesn't know how to decode the chunked encoding?
> 
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


Re: [users@httpd] Apache2 sends wrong header

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 13 Nov 2002, Simon Dassow wrote:

> Hi again,
> correction, recently i've got the same for a ruby script...
>
> Now i believe that it is a apache-problem.
> The '0' at the beginning and at the end are strange, also the '9d5'
> before content.
> A step closer, but still no clue what it could be.

This is most likely "chunked encoding".  Do you have some reason to
believe that Apache shouldn't be sending chunked encoding in this case?
Are you testing with a real browser, or is this perhaps a home-grown
script that doesn't know how to decode the chunked encoding?

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


Re: [users@httpd] Apache2 sends wrong header

Posted by Simon Dassow <ja...@area319.de>.
Hi again,
correction, recently i've got the same for a ruby script... 

Now i believe that it is a apache-problem.
The '0' at the beginning and at the end are strange, also the '9d5'
before content.
A step closer, but still no clue what it could be.

regards,
simon


whole output:
---------
0

HTTP/1.1 200 OK
Date: Wed, 13 Nov 2002 13:46:00 GMT
Server: Apache/2.0.43 (Unix) mod_ssl/2.0.43 OpenSSL/0.9.6g
Keep-Alive: timeout=15, max=96
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=ISO-8859-1

9d5
<font color="blue">PATH</font>: <font
color="green">/bin:/usr/bin:/usr/local/bin</font><br/>
<font color="blue">UNIQUE_ID</font>: <font
color="green">0SEZNNmghBsAAGMQ4IYAAAAC</font><br/>
<font color="blue">HTTPS</font>: <font color="green">on</font><br/>
<font color="blue">HTTP_HOST</font>: <font
color="green">admin.serva319.de</font><br/>
<font color="blue">HTTP_USER_AGENT</font>: <font
color="green">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0)
Gecko/20020808</font><br/>
<font color="blue">HTTP_ACCEPT</font>: <font
color="green">text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1</font><br/>
<font color="blue">HTTP_ACCEPT_LANGUAGE</font>: <font
color="green">en-us, en;q=0.50</font><br/>
<font color="blue">HTTP_ACCEPT_ENCODING</font>: <font
color="green">gzip, deflate, compress;q=0.9</font><br/>
<font color="blue">HTTP_ACCEPT_CHARSET</font>: <font
color="green">ISO-8859-1, utf-8;q=0.66, *;q=0.66</font><br/>
<font color="blue">HTTP_KEEP_ALIVE</font>: <font
color="green">300</font><br/>
<font color="blue">HTTP_CONNECTION</font>: <font
color="green">keep-alive</font><br/>
<font color="blue">SERVER_SOFTWARE</font>: <font
color="green">Apache/2.0.43 (Unix) mod_ssl/2.0.43
OpenSSL/0.9.6g</font><br/>
<font color="blue">SERVER_NAME</font>: <font
color="green">admin.serva319.de</font><br/>
<font color="blue">SERVER_ADDR</font>: <font
color="green">217.160.132.27</font><br/>
<font color="blue">SERVER_PORT</font>: <font
color="green">443</font><br/>
<font color="blue">REMOTE_ADDR</font>: <font
color="green">217.7.97.231</font><br/>
<font color="blue">DOCUMENT_ROOT</font>: <font
color="green">/pool/www/serva319.de/admin/http</font><br/>
<font color="blue">SERVER_ADMIN</font>: <font
color="green">webmaster@serva319.de</font><br/>
<font color="blue">SCRIPT_FILENAME</font>: <font
color="green">/pool/www/serva319.de/admin/http/ruby.x</font><br/>
<font color="blue">REMOTE_PORT</font>: <font
color="green">54333</font><br/>
<font color="blue">GATEWAY_INTERFACE</font>: <font
color="green">CGI/1.1</font><br/>
<font color="blue">SERVER_PROTOCOL</font>: <font
color="green">HTTP/1.1</font><br/>
<font color="blue">REQUEST_METHOD</font>: <font
color="green">GET</font><br/>
<font color="blue">QUERY_STRING</font>: <font color="green"></font><br/>
<font color="blue">REQUEST_URI</font>: <font
color="green">/ruby.x</font><br/>
<font color="blue">SCRIPT_NAME</font>: <font
color="green">/ruby.x</font><br/>

0
---------

On Wed, 2002-11-13 at 14:05, Simon Dassow wrote:
> Hi all,
> i'm currently using apache2 with php, running it as cgi-version thru
> suexec.
> No problem yet, but when it comes to SSL, i'm getting strange headers.
> 
> Example:
> --------
> 0
> 
> HTTP/1.1 200 OK
> Date: Mon, 11 Nov 2002 11:31:32 GMT
> Server: Apache/2.0.43 (Unix) mod_ssl/2.0.43 OpenSSL/0.9.6g
> --------
> 
> The '0' is the reason why the browser offers the document to be
> downloaded.
> I dont know what to do... seems that its only happening with php, but
> php is sending the headers after that, so there must be something wrong.
> But other cgi-scripts (i.e. perl or ruby) are running fine, only with
> php i get those strange headers.
> 
> Some ideas? (I've posted allready a bugreport to the php developers, but
> the say it's a apache-problem (which i really cant believe) here:
> http://bugs.php.net/bug.php?id=20356 ).
> 
> Thanks and regards,
> simon
> 
> 
> ---------------------------------------------------------------------
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>