23.4.1. Starting Multiple Copies of vsftpd

23.4.1. Starting Multiple Copies of vsftpd

Sometimes one computer is used to serve multiple FTP domains. This is a technique called multihoming. One way to multihome using vsftpd is by running multiple copies of the daemon, each with its own configuration file.

To do this, first assign all relevant IP addresses to network devices or alias network devices on the system. Refer to Chapter 15, Network Configuration for more information about configuring network devices and device aliases. Additional information can be found about network configuration scripts in Chapter 14, Network Interfaces.

Next, the DNS server for the FTP domains must be configured to reference the correct machine. For information about BIND and its configuration files, refer to Chapter 17, Berkeley Internet Name Domain (BIND).

For vsftpd to answer requests on different IP addresses, multiple copies of the daemon must be running. The first copy must be run using the vsftpd initscripts, as outlined in Section 23.4, “Starting and Stopping vsftpd. This copy uses the standard configuration file, /etc/vsftpd/vsftpd.conf.

Each additional FTP site must have a configuration file with a unique name in the /etc/vsftpd/ directory, such as /etc/vsftpd/vsftpd-site-2.conf. Each configuration file must be readable and writable only by root. Within each configuration file for each FTP server listening on an IPv4 network, the following directive must be unique:


Replace N.N.N.N with the unique IP address for the FTP site being served. If the site is using IPv6, use the listen_address6 directive instead.

Once each additional server has a configuration file, the vsftpd daemon must be launched from a root shell prompt using the following command:

vsftpd /etc/vsftpd/<configuration-file> [amp   ]

In the above command, replace <configuration-file> with the unique name for the server's configuration file, such as /etc/vsftpd/vsftpd-site-2.conf.

Other directives to consider altering on a per-server basis are:

For a detailed list of directives available within vsftpd's configuration file, refer to Section 23.5, “vsftpd Configuration Options”.

To configure any additional servers to start automatically at boot time, add the above command to the end of the /etc/rc.local file.

Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.