httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <>
Subject Re: WWW Form Bug Report: "More than 126 virtual hosts fails" on BSDI
Date Sat, 09 Nov 1996 16:12:05 GMT


Thanks for the information. We might be able to add it to a section of
the documentation.

rob wrote:
>Operating system: BSDI, version: 2.1
>Version of Apache Used: 1.1.1
>Extra Modules used: 
>URL exhibiting problem: 
>If you attempt to use more than 126 virtual host
>definitions each with their own error, and access
>log files the server will fail to service requests
>when you define the 127th virtual host.
>(I know you guys like it when there is a solution)
>You need to first make sure you actually have enough
>open file descriptors defined both in the Kernel and 
>in the /etc/login.conf file.
>In the kernel be sure you set the option 
>       OPEN_MAX=512
>In the /etc/login.conf file set the maximum number
>of open files for daemon processes to 512
># Settings used by /etc/rc
>        :maxproc=256:\
>        :openfiles=512:\
>        :datasize=32M:
>Now for the less than obvious:
>You need to increase the size of FD_SETSIZE define
>used by the select call.  If you do not you will
>forever be stuck with 126 virtual hosts.  The select
>call (or more specifically the macros defined in 
>sys/types.h) use a bit field that only 256 bits wide.
>Hence if the process has more than 256 files open the
>select/accept call fails as the total number of file descriptors exceeds
>the bit field boundries.
>To fix the problem I just added the following define
>to http_main.c
>#define FD_SETSIZE      512
>Any routine that uses the struct "fd_set" should 
>have the above define set.  The only other module
>(which I'm not using) that uses the data structure
>is mod_proxy.c.
>This thing drove me nuts and I hope you guys can add it 
>to the "Tunning" and "Virtual Hosts" sections of the
>web site as well as add the ifdef BSDI... along with
>a comment to the appropriate source files.
>I always like to give back when ever possible.
>Thanks for the great server,
>Kevin Brooks 

Rob Hartill.       Internet Movie Database Ltd.  

View raw message