2

I have IIS running two sites + IIS virtual folders (w3root) on a win 2k3 server. I wondered if there were any way to also piggyback FTP traffic on that pipe by using port 80 on the ftp server.

How would I do this and still keep the web stuff running without interruption?

4 Answers 4

8

No, you cannot run HTTP and FTP on the same TCP port of the same IP address. If you are looking for a way to upload files via Port 80 to a web server, WebDAV may be an option.

You may be interested in a tutorial on using WebDAV with IIS on Server 2003

Don't forget about security! FTP is an outdated and insecure protocol that should never be used over the public internet, except for anonymous downloads. FTP sends both your username/password and your data in plaintext. SFTP and FTPS are reasonable alternatives.

If you cannot use SSL at all times, enabling Digest Authentication will prevent your WebDAV login passwords from being sent in plaintext.

3
  • Erm, I'm pretty sure FTPES or FTPS send the username and password combo only after its negotiated a secure connection
    – TheLQ
    Mar 20, 2012 at 15:08
  • 1
    I said nothing intended to discourage the use of secure alternatives/extensions to FTP. Quite the opposite, in fact. Happy to add a clarification if it pleases you.
    – Skyhawk
    Mar 20, 2012 at 15:45
  • @MilesErickson, actually you could run HTTP and FTP on the same port (see my answer), not that I would recommend it... Do you think FTP is less secure than (plain) HTTP? It seems unfair to compare SFTP/FTPS to FTP without talking of WebDAV over HTTPS as well.
    – Bruno
    Mar 20, 2012 at 16:11
2

You could just serve the directories with the HTTP server.

Also, you can use a squid proxy to put some requests on your http server, and other (http) requests it can ask a ftp server about.

But no, in principle you can't put two programs on one port.

1

You could also add an FTP binding to the site. It wouldn't run on port 80, but would allow FTP to be used against the same content folders.

1

You could use port unification to bind the two protocols on the same port. You would probably have to write your own application listening on that port though, in a similar way to what sslh does.

Essentially, this application would listen on port 80 and dispatch the request depending on what it gets. Since HTTP is a protocol where the clients talks first and FTP is a protocol where the server talks first, you would have to wait x milliseconds to see whether the client has sent an HTTP request. If so, dispatch it to your actual HTTP server (probably effectively running on another port), otherwise, dispatch the connection to your FTP server.

You could, in principle have multiple protocols where the client talks first and try to detect which protocol is used by looking at the request. You can't have more than one protocol where the server talks first.

It's clearly not a "clean" way of addressing this problem, it's mostly a workaround that may be useful in environments where you're not in control of the network and someone has put limitations (perhaps arbitrarily) on the ports you can use. Otherwise, it's better to stick to the official port for each protocol. WebDAV can be a reasonable alternative to FTP if you're constrained to use HTTP.

3
  • Well sure, you can write your own proxy-app to do whatever you want. I can't think that would often be the correct solution to the problem though, not for most sysadmins.
    – mfinni
    Mar 20, 2012 at 16:39
  • @mfinni, it completely depends on the environment. Sometimes, if your ISP blocks your SSH port but not your HTTPS, for example, you might still want to be able to log in. The question is about whether it's possible to piggy-back on another port, it doesn't quite say which constraints led to this requirement, so it's hard to know. Most sysadmins might not have restrictions on which ports they can choose to block or use (since they tend to have control over that too). However, some have to work under different constraints sometimes.
    – Bruno
    Mar 20, 2012 at 16:44
  • 1
    No ISP should be blocking those ports for a business account, though.
    – mfinni
    Mar 20, 2012 at 16:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .