P� s�ndag, 11 april 2004, skrev Rod Roark:
> On Sunday 11 April 2004 07:04 am, Peter Jay Salzman wrote:
> ...
> >    NameVirtualHost 64.142.25.39:80
> > 
> >    <VirtualHost www.liberal.ws:80>
> >       ServerAdmin [EMAIL PROTECTED]
> >       DocumentRoot /home/p/linux
> >       ServerName www.liberal.ws
> >       ErrorLog /var/log/apache/test_error
> >       LogLevel warn
> >       CustomLog /var/log/apache/test_access common
> >    </VirtualHost>
> 
> What works for me looks like this:
> 
>    NameVirtualHost 64.142.25.39
>    <VirtualHost 64.142.25.39:80>
>       etc.

Rod is right; you need the NameVirtualHost directive when virtual hosts share
the same IP address (i.e., there are multiple DNS A records for your the IP
address of your server, or there are CNAME records giving it additional
names).

I have DNS names, not IP addresses, in my declarations of NameVirtualHost and
VirtualHost. It seems to work fine either way.

There is another technique for virtual hosts, now little used, involving a
different IP address for each virtual host. For example, bar.foo.org might be
served via eth0, while baz.foo.org via eth0:1. In this case you do not need
the NameVirtualHost directive. I have used this method; it was useful back
when some browsers did not support virtual hosts and when static IP addresses
were not so scarce.

-- 
Henry House
The unintelligible text that may follow is a digital signature. 
See <http://hajhouse.org/pgp> for information.  My OpenPGP key:
<http://hajhouse.org/hajhouse.asc>.

Attachment: signature.asc
Description: Digital signature

Reply via email to