In some circumstances you may want your machine to be known by several host names and respond with different content for each name. This allows one physical machine (say webfarm.net) to serve content for www.company1.com and www.company2.com.
In order to configure your system to serve multiple host names you must tell your operating system to listen for connection requests for each host name and then either run an HTTP server for each host name or run an HTTP server that can service multiple ports simultaneously.
Many versions of UNIX allow you to listen for multiple host names even if you have only one network interface. The command that configures network interfaces is usually called ifconfig.
Here's how to use ifconfig on Solaris 2.x (SunOS 5.x):
su ifconfig le0:1 www.company1.com up ifconfig le0:2 www.company2.com up
The Solaris 2.x startup procedure will automatically execute the ifconfig commands for you if you create the files /etc/le0:1 and /etc/le0:2 with the corresponding host names as contents:
su echo > /etc/le0:1 www.company1.com echo > /etc/le0:2 www.company2.com
You must specify the host name to which each HTTP server should respond. This is typically done with the ServerName and BindAddress directives. For example, to configure the Apache HTTP server, add the following lines to the httpd.conf file:
<VirtualHost www.company1.com> ServerAdmin firstname.lastname@example.org DocumentRoot /mnt/apache/etc/httpd/htdocs ServerName www.company1.com ErrorLog logs/www.company1.com-error_log TransferLog logs/www.company1.com-access_log </VirtualHost>
The FrontPage Server Extensions support multihoming on UNIX. To do this, run fpsrvadm.exe. You must install the Server Extensions separately for each different virtual host.