Re: Apache Virtual Users


Subject: Re: Apache Virtual Users
From: James Zuelow (e5z8652@zuelow.net)
Date: Wed Oct 23 2002 - 10:53:59 AKDT


On Wed, 23 Oct 2002 08:34:03 -0800
"Brian ThunderEagle" <furbs@mail.swjedi.net> wrote:

>
> Alright, I trid it, and It kindof works, however here is what happens now.
> I can get furbs.swjedi.net to open the user page, however www.swjedi.net also
> opens the user page. Here is how I set up my file:
>
> <VirtualHost 192.168.0.1>
> DocumentRoot /var/www/public_files/furbs/
> ServerAdmin furbs@swjedi.net
> ServerName furbs.swjedi.net

OK, this came up last time VirtualHosts were discussed.

For name based virtual hosts, don't specify an IP address. (You should be using IP based virtual hosts for that). In your case, you're running a server behind a NAT firewall, so things SHOULD all arrive on the 192.168 interface, but in practice I've never been able to get it to work. Just skip the whole problem by using an asterisk.

Your httpd.conf should look something like this:

NameVirtualHost *
<VirtualHost *>
        ServerName some.server.com
        # Note this is the default server and will be shown to requests that just use an IP
        # or the machine name.
</VirtualHost>
<VirtualHost *>
        ServerName some.other.com
        # If you don't have DNS or have put this server in /etc/hosts, you'll never see this one
</VirtualHost>

The asterisk tells Apache to use the name based virtual host regardless of which IP the request arrives on. Specifying an IP is probably something that a hosting company needs to worry about, but in your case I think it is just adding needless complexity and a point of failure.

HTH,

James

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Wed Oct 23 2002 - 10:51:14 AKDT