I wrote a patch for apache in the 1.3 days to take a list of fd's
on the command line that were already bound to the required Listening
sockets. This was so that I could a have a simple setuid wrapper
for listening on port 80 which would then fork and exec apache after
removing root privileges.

The tricky bit was matching the Listen addresses' with the addresses
available on the provided sockets.

This idea would also work for replacing the running server with a
different version. The older server just has to exec the new image
keeping the sockets open.

Cheers, Roger


On Wed, Oct 11, 2006 at 05:39:57PM -0700, Gokul P. Nair wrote:
> Very cool indeed! A quick 'man 2 bind' yeilded this:
>
> EINVAL The socket is already bound to an address. This may change in the future: see
> linux/unix/sock.c for details.
>
> I'd be curious to find out what nginx does to circumvent this, atleast on linux.
>
> - Gokul
>
> ----- Original Message ----
> From: Jonathan Vanasco
> To: modperl mod_perl
> Sent: Wednesday, October 11, 2006 3:16:30 PM
> Subject: concurrent servers
>
> I've switched my port80 proxy / vanilla server to nginx. it's a
> great little server out of russia.
>
> It happens to feature a rather neat thing as well...
> when you upgrade the binary , you can have it start up a new binary,
> bind to 80 ( along with the existing one ) , then have the old binary
> shut down
> the effect is a seamless upgrade with no downtime
>
> see: http://wiki.codemongers.com/NginxCommandLine and the section
> "Upgrading To a New Binary On The Fly"
>
> is there any way to do that with apache2/mp2 ?
>
> apache doesn't seem to like to bind to any port that something else
> is running on. i couldn't find an override anywhere.
>
>
>
>
>
>