You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Hugh Williams <hu...@soco.agilent.com> on 2003/04/08 19:55:52 UTC

[users@httpd] multiple host/virtual host question

Hi;

I need to run web servers as different users due to permission issues
with content owners.  The Virtual host documentation indicates that in
order to use the "User" and "Group" comands within a virtual host, I
must have suexec set up and running properly.  I do not have this set
up, so I am falling back to running separate Apache daemons - distinct
httpd, httpd.conf, document roots and so forth.

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.

Thanks,

hugh

-- 
 Hugh Williams			"And the time will come when you'll see
 hugh_williams@agilent.com  	 We're all very small
 Agilent Technologies 		 And life flows on within you and without you"
 Santa Rosa 2LS-R				- Beatles
 (707)-577-4941

---------------------------------------------------------------------
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] multiple host/virtual host question

Posted by Joshua Slive <jo...@slive.ca>.
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.

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