Virtual hosting is a method for sharing multiple domain names on a
single instance of a server. The client provides the server with the
hostname that it has used to establish the connection, and that name
is compared against a table of virtual hosts configured for the
server. If the hostname matches a virtual host, the client will use
the root directory and any virtual paths that have been assigned to
When the server is first started, a default virtual host with an ID
of zero is automatically created and is identified as
httpHostDefault. This virtual host uses the same hostname, port
number and root directory that the server instance was created with.
The application should treat all other host IDs as opaque values and
never make assumptions about how they are allocated.
The virtual host ID returned by this method can be used with the
AddPath method to create a virtual path assigned to the host, the
AddUser to create a virtual user, and the RegisterHandler
and RegisterProgram methods which are used to register script
handlers and CGI programs.