This method allows a computer with only one IP address to host many virtual web servers. The HTTP/1.1 protocol allows the web server to state by which names it wishes to be accessed. The great advantage of this method is that a practically unlimited number of servers can run on one computer and, furthermore, it simplifies configuration and use. The main disadvantage is that the client must support this part of the protocol. New browsers do this, but there are still older versions in use that do not.
The configuration of virtual web servers is achieved by means of the keyword NameVirtualHost. For example, the two virtual web servers www.universe.dom and www.cosmos.dom are defined for the IP address 192.168.0.50. Both names must be entered in the DNS server for the IP address. The definition is as follows:
If individual log files are defined for each virtual web server, the necessary directories and files need to be created first. They are not created automatically when Apache starts.
Was this article helpful?