IP Address Based Virtual Web Servers

The disadvantage of name-based virtual web servers is that only browsers that support HTTP/1.1 will recognize these servers. If older browsers should be supported, the virtual servers must be IP address-based. This requires an individual IP address for each of the virtual web servers. Until IPv6 is implemented, available IP addresses will remain in short supply, so the overwhelming majority of virtual web servers are name-based.

IP-based virtual web servers can also be installed on a machine with only one network card. Linux allows you to allocate several IP addresses to one network card. These virtual network cards have names like eth0:0, eth0:1, etc. Linux allows an unlimited number of virtual network cards on a single physical network card. To enable this, the kernel must have the IP Aliasing Support parameter built in.

The definition based on IP addresses is demonstrated by the following example:


ServerName www.universe.dom ServerAdmin [email protected] DocumentRoot /srv/www/htdocs/universe ErrorLog /var/log/httpd/universe/error.log CustomLog /var/log/httpd/universe/access.log common </VirtualHost>


ServerName www.cosmos.dom ServerAdmin [email protected] DocumentRoot /srv/www/htdocs/cosmos ErrorLog /var/log/httpd/cosmos/error.log CustomLog /var/log/httpd/cosmos/access.log common </VirtualHost>

All virtual web servers must be registered in the DNS database.

Was this article helpful?

0 0

Post a comment