RE: Apache, anyone?


Subject: RE: Apache, anyone?
From: James Zuelow (e5z8652@zuelow.net)
Date: Wed Sep 11 2002 - 09:21:39 AKDT


On Tue, 10 Sep 2002, Mark-Nathaniel Weisman wrote:

>
> If you're doing Virtual hosting you've got two pieces of the Virtual
> Host that you must concern yourself with. The first is to identify this
> host. Firstly, you may have a directory and host setup where the "Main
> Server" configuration section begins that may conflict with your Virtual
> hosts. However, typically if you've got the Virtualhosts setup (as demo
> below) you need to do a restart on httpd services and you're on your way
> to demonstrating your wares. Have fun.
>
> >> NameVirtualHost IP.Add.res.s:Port
>
> Then you've got to set up each virtual host(as an example);
> <VirtualHost IP.Add.ress.s:Port>
> ServerAdmin whoever@getstheblame.com
> DocumentRoot /home/httpd/html
> ServerNaame www.getstheblame.com
> ErrorLog /home/httpd/html/getstheblame-error_log
> CustomLog /home/httpd/html/getstheblame-access_log common
> </VirtualHost>
>
>
This is primarily for akluggers who are just getting started with Apache:

One thing you can do to make name based virtual hosts a little easier to
manage is NOT use an IP address in the NameVirtualHost and <VirtualHost>
directives. Use an asterisk instead, and the virtual hosts will reply to
all IP addresses that the server is listening on. (Of course this is more
appropriate for a SOHO user with only one or two public IP addresses -
someone doing web hosting would probably want to specify the IP address,
but then they might as well just use an IP based virtual host.) One of the
things that Stephen mentioned in his original post was that he wanted to
access the virtual hosts both from the net AND from localhost.

If you use

NameVirtualHost *
<VirtualHost *>
        ServerName www.example.com
        (etc.)
</VirtualHost>

your virtual host will be live regardless of the IP address in use. This
is handy when you want to see the sites from more than one different
network. In my case I need my sites accessible from the Internet, my LAN,
and localhost.

If you want to specify an IP address for a virtual host (say for the web
hosting business) you need to duplicate it for other networks. So for
example www.example.com is hosted on your equipment at 111.22.33.44 for
Internet customers. If you copy and paste the virtual host and set it to
127.1.2.3, then the virtual host will be available on the localhost.
(Remember that the entire 127.0.0.0 address range is available for
localhost - you are not limited to 127.0.0.1). IMHO the asterisk is easier
for the average home setup with only a few domain names on it.

(By the way if you're in Juneau we'll be setting up virtual hosts at this
month's meeting. We can demo both ways of doing name based virtual
servers & look at IP based virtual servers if anyone is interested.)

Cheers,

James

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



This archive was generated by hypermail 2a23 : Wed Sep 11 2002 - 09:33:22 AKDT