Virtual Hosts In Serv-U - KB Article #1742Related Articles --
The Serv-U File Server allows multiple domains to be configured using the same listening ports. This means that an administrator can have three domains configured on the same IP address all listening on port 21, greatly reducing the IP addressing logistics of managing multiple domains. This is done through the use of Virtual Hosts.
Virtual Hosts work through the use of "host headers", which allow Serv-U to identify which domain a user is trying to connect to. These are supplied automatically when a user connects to Serv-U via HTTP or HTTPS - when connecting via FTP/FTPS, the user must connect using a client that supports the use of the HOST command to specify which domain is being used, such as FTP Voyager.
When using an FTP/FTPS client which does not support the HOST command, it is still possible to log on using Virtual Domains in Serv-U. To send the "Virtual Host" information through to Serv-U, use the following format for the username when connecting:
By specifying the domain name followed by the "pipe" character, followed by the username, Serv-U knows which user is connecting to the server and can allow the user to authenticate to the proper domain.
NOTE 1: When utilizing host headers, all users must connect using the Fully Qualified Domain Name of the server and cannot connect using the IP address, or Virtual Hosts will not work and the user will be unable to connect. For example, a user must connect to ftp.Serv-U.com and not 220.127.116.11.
Configuring Virtual Hosts In Serv-U
To configure Virtual Hosts in Serv-U, first set up all domains that need to be in place. Select one domain to handle incoming connections - this will be your "Default Domain" and will handle all incoming login requests.
Once this is done, open all of the other domains and delete the listeners stored in the "Domain Details | Listeners" menu of those domains so that they cannot "intercept" authentication requests.
Then, navigate to the Domain Details | Virtual Hosts menu, click on the "Add" button and type in the Virtual Host name (such as ftp.Serv-U.com, replace with your domain name). Be sure to do the same for each domain configured in Serv-U that shares listening ports. Then, once connecting via the Fully Qualified Domain Name, users will be able to access multiple domains on the same port in Serv-U!
NOTE 2: Virtual Hosts do not work when you use FTPS or HTTPS, which rely on a unique certificate bound to a unique IP address (not to be confused with a typical certificate which is bound to a domain name). If any domains are deployed which use FTPS or HTTPS, Virtual Hosts cannot be used to share that IP address, and any other domains on the same server must use other port numbers or different IP addresses.