httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: [users@httpd] multiple host/virtual host question
Date Tue, 08 Apr 2003 18:01:29 GMT

On Tue, 8 Apr 2003, Hugh Williams wrote:
> My server has two CNAMEs, and my idea is to have one web listener
> respond for each name.  Question:  Is there a way to configure these
> Apache servers so that they can both listen on port 80, yet only take
> the requests that come in for their particular CNAME?  So:
> hardware name = sysone
> CNAME         = systwo
> CNAME         = systhree
> I want requests to 'sysone' to be ignored, requests to 'systwo' to be
> served (only) by one Apache, and requests to 'systhree' to be served
> (only) by the other Apache.
> Can the two httpd.conf files be this polite?  My first attempts only
> seem to allow one server to start, the other hangs.  I presume this is
> due to competing for port 80, but would appreciate any enlightenment.

No, this is technically impossible because the hostname is not known until
Apache reads the Host: header in the request.

Your choices are:

1. (easy) Dedicate an IP address to each hostname and use the
Listen directive to restrict each apache to the appropriate IP address.

2. (hard) Use a single apache on Port 80 that simply reads requests on two
name-based virtual hosts and passes them (via ProxyPass) to your two other
apaches which are bound to different ports.

The perchild mpm in apache 2 is essentially a slightly more efficient
version of number 2, but it is not stable enough to use.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message