1.3 virtuald

When you FTP into a server, how does it differentiate which virtual directory to chroot to? This is done by a small wrapper (written in C) that informs your services (usually set up in /etc/inetd.conf) where to start. Tha name of this nifty program is virtuald. Basically virtuald reads in a configuration file and matches the IP address of a server called upon to the directory where the files reside. Virtuald then hands this information off to the service, and the service carries on as usual.

For example, you set up a virtual server, vserver1.com, and vserver2.com. In your configuration file you map out the IP address for each of these servers, to point to their proper location on your main server (/virtual/vserver1.com and /virtual/vserver2.com). You configure your inetd to run a specific service through virtuald, say FTP. When a user FTP's to vserver2.com, virtuald will lookup the directory for the certain server, and chroot to it, setting /virtual/vserver2.com to make it seem like the root (/) directory to the user. The FTP service will then know where to start. If no matching IP address is found, the service runs through as normal logging into the main server. For each service there should be a different configuration file.

Don't worry about the configuration files, as Virtfs automatically adds or deletes the entries within it as needed. Virtuald is contained within the Virtfs package.