Re: Apache virtual server


Subject: Re: Apache virtual server
From: Graham Leggett (minfrin@sharp.fm)
Date: Mon Nov 19 2001 - 04:57:53 MST


Paul Guba wrote:

> you are correct, what I need is a virtual web server. I will look at
> that config file again in the morning. Is there a need to make a port
> listen. Where is actual server named? Did you leave that as
> localhost? This is all very new to me so sorry for misuse of wording.

The config has a few bits, each bit leads on to the next.

The first bit is where you tell Apache what IP addresses and ports
Apache should attach to, like this:

Listen 127.0.0.1:80
Listen 192.168.0.1:80
Listen 192.168.0.1:9876
<etc>

The above values are examples, but show how you can define more than
one, and on non-standard ports.

Then - if you want to support name-virtual hosts (ie many websites
sharing one single IP address / port combination) use the following
optional additional line:

NameVirtualHost 192.168.0.1:80

What this is saying is "out of all the Listen directives I defined
above, this particular IP/port combination should have multiple websites
hanging off it". Note that this is in addition to, and not in
replacement of, the Listen directive above.

Then - finally, define each virtual host within a virtual host
container, like so:

<VirtualHost 192.168.0.1:9876>
  VHost specific directives go here
</VirtualHost>

# www.domain1.com resolves to 192.168.0.1 in the DNS
<VirtualHost www.domain1.com:80>
  ServerName www.domain1.com
  VHost specific directives go here
</VirtualHost>

# www.domain2.com also resolves to 192.168.0.1 in the DNS
<VirtualHost www.domain2.com:80>
  ServerName www.domain2.com
  VHost specific directives go here
</VirtualHost>

Regards,
Graham

-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."




This archive was generated by hypermail 2a24 : Mon Nov 19 2001 - 06:32:30 MST