home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] DSL, .11g router, apache, bind, port forwarding on a small network.

  • Subject: Re: [OCLUG-Tech] DSL, .11g router, apache, bind, port forwarding on a small network.
  • From: "Dan Langille" <dan [ at ] langille [ dot ] org>
  • Date: Sat, 08 Apr 2006 10:13:40 -0400
On 8 Apr 2006 at 8:38, Michael Thomas wrote:

>  
> >
> >
> > This is what I have in vhost.conf (the mandrake way is to include the 
> > section as a different file).
> >
> > <VirtualHost 192.168.10.2>
> > ServerName www.myservername.net
> > DocumentRoot /var/www/html
> > </VirtualHost>
> >
> > NameVirtualHost 192.168.10.2
> > <VirtualHost 192.168.10.2>
> > ServerName www.myvirtualhost.com
> > DocumentRoot /home/user/public_html
> > </VirtualHost>
> >
> > It is configured this way as it seems to be the only way it wants to 
> > work for both, at least locally. If I leave the main one out, the 
> > second overrides my main site. Then, if I use the NameVirtualHost 
> > directive prior to the first entry, httpd, when restarted, complains 
> > that one will override the other, and only the first is to be used. 
>  
> 
>  It should be as follows. You only need one NameVirtualHost per ip 
> address/port pairing. Here port 80 is implied.
> 
> NameVirtualHost 192.168.10.2
> 
> <VirtualHost 192.168.10.2>
> ServerName www.myvirtualhost.com
> DocumentRoot /home/user/public_html
> </VirtualHost>
> 
> <VirtualHost 192.168.10.2>
> ServerName www.myservername.net
> DocumentRoot /var/www/html
> </VirtualHost>

As well, if you have just one IP, you can use this instead:

<VirtualHost *>



-- 
Dan Langille : Software Developer looking for work
my resume: http://www.freebsddiary.org/dan_langille.php