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: sberaud <sberaud [ at ] pppoe [ dot ] ca>
  • Date: Sat, 08 Apr 2006 10:36:11 -0400
Alas the way I wrote was the only way that allows both to work at all. Both of the ways described below (as described in the docs as well) do not work.

Michael's way results in the server complaining that there are no virtual hosts on my subnet and with a hint "perhaps you should use namevirtualhost" (which I was already), and Dan's way results in httpd complaining there are no virtual hosts anywhere. Later documentations also suggests using * here will result in the server stopping listening to any port as it would end up trying to listen in on all of them, in complete disagreement with the earlier section that suggested using it.

All very confusing and odd because I have set 9.1 up a couple times with virtual hosts in the past and never had this issue.

Thanks for the input, I will have to keep trying.

Scy








Dan Langille wrote:
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 *>