
736
Configuring Virtual Hosts
Figure 6-4:
The Edit an
Address
dialog box.
If you want to restrict access to certain IP addresses, select the All Available
Addresses line, click the Edit button, select the Address radio button, and
then enter the address you want to allow access to. You can enter a single IP
address, but you’re more likely to enter a partial IP address or an IP/netmask
combination. For example, to allow access to all addresses from 212.66.5.0 to
212.66.5.255, you could enter either of the following:
212.66.5
212.66.5.0/255.255.255.0
If you want to allow access to a list of specific IP addresses, you can add
lines to the Available Addresses list box. First, though, you should remove
the All Available Addresses line or edit it to allow just a single address. Then,
click the Add button to add addresses you want to allow.
Configuring Virtual Hosts
A virtual host is simply a Web site with its own domain name hosted by an
Apache server. By default, Apache is set up to serve just one virtual host.
However, you can add more virtual hosts. As a result, a single Apache server
is able to host more than one Web site.
For example, if I were so inclined, I might set up an Apache server to host my
own personal Web site (www.lowewriter.com) that has information about
my books and a second Web site (www.hauntedlowes.com) that has infor-
mation about my favorite hobby, decorating my house for Halloween. Both
of these Web sites could be implemented as virtual hosts on a single Apache
server.
To configure a virtual host (including the default virtual host if you have
only one), you use the Virtual Hosts tab of the HTTP configuration tool, as
shown in Figure 6-5.
Configuring the default host
Even if you don’t plan on creating additional virtual hosts, you can still use
the Virtual Hosts tab to configure the default virtual host for your Web site.
To do so, select the virtual host in the Virtual Hosts list and click the Edit
button. This brings up the Virtual Host Properties dialog box, as shown in
Figure 6-6.
68_625873-bk09ch06.indd 73668_625873-bk09ch06.indd 736 9/21/10 10:47 PM9/21/10 10:47 PM