Tuy nhiên, khi bạn nhìn vào Internet, một trong những máy tính xuất bản các trang Web cho nhiều lĩnh vực. Điều này có nghĩa là một nơi nào đó máy chủ nhiều hơn thế cho một tên miền. Thời hạn cho điều này là ảo lưu trữ, hoặc multihomed lưu trữ. | 460 Part V Linux Server Enabling Virtual Hosting As a single server for a home or small business you may not need to change a Web server much from the default for the one domain. However when you look at the Internet one machine publishes Web pages for many domains. This means that somewhere a machine hosts more than that for one domain. The term for this is virtual hosting or multihomed hosting. In either case you can configure the server to publish Web pages for more than one domain name. Domain names that are not associated with a real network or machine are considered virtual. There are a couple of methods to make a virtual domain name available on a Web server. The first is to give each virtual domain an IP address in the domain name server DNS and assign the IP address to the Linux machine. You can find more information about adding an IP address to a machine in Chapter 5. For Internet use these domain names and IP numbers must be registered and real. Making up names or IP numbers does not work. The other option is to assign the domains as conical names CNAME in the DNS. In the case of real IP addresses you need to add the information about the virtual server to the file. The following is an example of how to set the directives in the configuration file. These directives override the global directives set for the server when requests come in for this virtual domain. VirtualHost ServerAdmin webmaster@ DocumentRoot var www ServerName ErrorLog var log apache TransferLog var log apache VirtualHost However when using one IP address for multiple domain names you need to change one more line in the file. You must assign an IP address to the NameVirtualHost directive to identify the IP address to the Apache Web server. This line might look like this in your configuration file NameVirtualHost The server then uses a variable