Problems with sample httpd setup

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems with sample httpd setup

Erik Reitsma (RY/ETM)-2
If you flatten the error list (e.g. lists:flatten(...)), you will find that the error is:

"Error reading request: header too long: 256 + 223"

May somebody wiser find what this means for you.

> I'm running the Open Source Erlang packaged with Debian
> Linux; version 7.3,
> containing erts version 5.0.2.4 and inets version 2.5.6.
>
> Having copied the sample server_root to '/var/tmp' and set
> the ServerName,
> I can then start httpd successfully using the method prescribed in
> the docs:-
>
>   Erlang (BEAM) emulator version 5.0.2.4 [source]
>
>   Eshell V5.0.2.4  (abort with ^G)
>   1> httpd:start().
>   {ok,<0.31.0>}
>
> However, when I then make a request (from a variety of
> standard browsers) to
> the server (via http://localhost:8888/), the server
> disconnects and the error
> log shows up the following mis-formatted message which I partially
> decoded as 'Error reading request':
>
>   [08/Aug/2001:10:48:20 +0200] server crash for 127.0.0.1,
> reason: [69,
>     114, 114, 111, 114, 32, 114, 101, 97, 100, 105, 110, 103, 32, 114,
>     101, 113, 117, 101, 115, 116, 58, 32, [104, 101, 97, 100,
> 101, 114,
>     32, 116, 111, 111, 32, 108, 111, 110, 103, 58, 32, "256",
> 32, 43, 32,
>     "223"]]
>
> Is this a known problem? Any help would be appreciated. (I
> would prefer to
> get a working example configuration for my installed erlang
> components than
> to upgrade those components.)
>
> Thanks in advance,
>
> -Steve
>


Reply | Threaded
Open this post in threaded view
|

Problems with sample httpd setup

Steve Purcell
Erik Reitsma (ELN) wrote:
> If you flatten the error list (e.g. lists:flatten(...)), you will find
> that the error is:
>
> "Error reading request: header too long: 256 + 223"

Aha! Thanks.

> May somebody wiser find what this means for you.

I got lucky and figured it out myself by following the error message back
to its source in the code; I needed to add the following to the httpd
conf file:

  MaxHeaderSize 800

Then, everything appears to work okay.

The default is 256, which would seem to be inadequate. (I'm still not sure
*which* header was too long.)

Thanks again,

-Steve


Reply | Threaded
Open this post in threaded view
|

Problems with sample httpd setup

Micael Karlberg-3
In reply to this post by Erik Reitsma (RY/ETM)-2
Erik Reitsma ELN wrote:
>
> If you flatten the error list (e.g. lists:flatten(...)),
> you will find that the error is:
>
> "Error reading request: header too long: 256 + 223"
>
> May somebody wiser find what this means for you.

This is actually the result of a bad default value. From the
notes file of release 2.6.0 (not yet released):

Bad choice of default values for MaxHeaderSize (256) and MaxBodySize
(1024). This in combination with a badly formatted error message makes the
resulting behaviour hard to diagnose.

Set these directives in the config file to something appropriate (higher).

/BMK

>
> > I'm running the Open Source Erlang packaged with Debian
> > Linux; version 7.3,
> > containing erts version 5.0.2.4 and inets version 2.5.6.
> >
> > Having copied the sample server_root to '/var/tmp' and set
> > the ServerName,
> > I can then start httpd successfully using the method prescribed in
> > the docs:-
> >
> >   Erlang (BEAM) emulator version 5.0.2.4 [source]
> >
> >   Eshell V5.0.2.4  (abort with ^G)
> >   1> httpd:start().
> >   {ok,<0.31.0>}
> >
> > However, when I then make a request (from a variety of
> > standard browsers) to
> > the server (via http://localhost:8888/), the server
> > disconnects and the error
> > log shows up the following mis-formatted message which I partially
> > decoded as 'Error reading request':
> >
> >   [08/Aug/2001:10:48:20 +0200] server crash for 127.0.0.1,
> > reason: [69,
> >     114, 114, 111, 114, 32, 114, 101, 97, 100, 105, 110, 103, 32, 114,
> >     101, 113, 117, 101, 115, 116, 58, 32, [104, 101, 97, 100,
> > 101, 114,
> >     32, 116, 111, 111, 32, 108, 111, 110, 103, 58, 32, "256",
> > 32, 43, 32,
> >     "223"]]
> >
> > Is this a known problem? Any help would be appreciated. (I
> > would prefer to
> > get a working example configuration for my installed erlang
> > components than
> > to upgrade those components.)
> >
> > Thanks in advance,
> >
> > -Steve
> >