### Enabling Creation of Name-Based Containers on a Virtuozzo Hardware Node

Virtuozzo name-based hosting is a Container-related implementation of a well-known technique of name-based web hosting, implemented, for example, in the Apache web server. Name-based web hosting is widely used alongside of IP-based web hosting. Unlike the latter, it refers to the process of running multiple "virtual" web servers on a single IP address of the host computer.

Virtuozzo name-based hosting enables the Hardware Node administrator to provide a single external IP address for all or a number of Containers hosted on that Node. All network requests received by the Node are redirected to the corresponding Container according to the domain name supplied by the requesting client, enabling the Hardware Node to differentiate among multiple Containers on the one IP address. Please, refer to the Virtuozzo Name-Based Hosting Guide for more details.

Note: Name-based hosting is supported by Virtuozzo versions not lower than 2.6. Thus, if the name-based hosting options are not shown on the Hardware Node configuration screen, this means that the Hardware Node either runs the Virtuozzo version lower than 2.6 or the Hardware Node is not available at the moment.

Important! Before registering a Hardware Node edit the Virtuozzo global configuration file on this Hardware Node by executing the commands:

/etc/sysconfig/vz

Change the name-based hosting parameter of the Virtuozzo global configuration file into "yes":

NBH="yes"

Restart Virtuozzo on the Hardware Node by executing the command:

/etc/init.d/vz restart

To register a hardware Node with name-based hosting allowed:

1. Select Virtuozzo Manager on the Service Director submenu.
2. Click Nodes on the Virtuozzo Manager submenu. The list of all Hardware Nodes registered appears on the screen.
3. Select the Virtuozzo Hardware Node.
4. Make the following changes to a Hardware Node Name Based Hosting settings under the General Settings tab:
   1. Check the Enable name based hosting on this hardware node box.
   2. Save settings.
   3. Refresh the screen to make sure that the name-based hosting service is started on the Hardware Node.

Important! Though name-based hosting allows a multitude of Containers to be accessible from the outside by one external IP address, it has nothing to do with the ability of these Containers to access hosts of the outer world. To enable the Containers, which have only internal IP addresses, to access the Internet, SNAT (Source Network Address Translation) or IP masquerading should be configured on the Hardware Node. This is ensured by the standard Linux iptables utility. To perform a simple SNAT setup, execute the following command on the Hardware Node:

# iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to ip_address

where ip_address is the external IP address of your Hardware Node. If you are using a number of physical network interfaces on the Node, you may need to specify a different interface for outgoing connections, e.g. -o eth2.

Note: To make it possible for name-based Containers to receive e-mail via SMTP protocol, these Containers hostnames should be resolved correctly by the service Container name server. The best way to handle this issue is to configure the DNS in such a way that the service Container on the Hardware Node that hosts name-based Containers will use the Parallels Business Automation - Standard name servers for domain names resolution.

To sell the name-based Containers, you can create the name-based Hosting Plans of the Virtuozzo Container type and enable the name-based hosting for these hosting plans.

Please send us your feedback on this help page