Re: [Proftpd-user] [SPAM] Re: Port in virtual hosts

"TJ Saunders" <[email protected]> Wed, 19 Jul 2023 08:04:20 -0700
Newsgroups gmane.network.proftpd.user
Message-ID <[email protected]>
>>> I haven't found that infomation clear in documentation so I'm asking: 
>>> if I would like to use lots of virtual hosts in proftpd do I have to 
>>> use different port in every virtualhost or can be the same for whole 
>>> server ?
>> 
>> While FTP protocol supports HOST command, and ProFTPD does support it,
>> I am not sure if many clients support that.
>> 
>> So, generally, you can define virtual hosts using different local IP
>> addresses, different ports, but it's not safe to assume that you can
>> run virtual hosts on the same host:port.
>> 
>> You can try but it may not work (unless you can order your customers
>> to use particular client that supports it)
>
> "You can try it"... I thought someone here will be sure that the same 
> port on virtual hosts is possible or not ;)

The short answer is: yes, it's possible to have multiple virtual hosts on the same IP address and port.

However, doing so requires support from clients as well.  As Fantomas pointed out, it requires that FTP clients send the HOST command -- and not all FTP clients do so.  This command is equivalent to HTTP's Host header, but is newer, and so not every FTP client implementation has been updated to use it.  Without that HOST command, ProFTPD only has the IP address/port combination from a client TCP connection to use for determining which virtual host to use -- and if there are many virtual hosts (differentiated by name) using the same IP address and port, it won't work as you expect.

Hope this helps,
TJ


_______________________________________________
ProFTPD Users List   <[email protected]>
Unsubscribe problems?
http://www.proftpd.org/list-unsub.html