1

I'm setting up OpenVZ to divide several of my sites from each other. I have one external ip address which I use to serve my sites. I'm using nginx to proxy http requests to nginx in each container which then proxies them to apache or fast-cgi and serves it's static content. I want to have something similar to nginx for FTP to proxy requests to corresponding FTP server inside container based on it's hostname. Is virtual hosting possible in FTP protocol based on DNS hostname?

P.S. for sure I can setup corresponding path to /vz/private/.... in FTP server's configuration on global zone but it's not very elegant solution. What are the best practices for shared hosting?

1 Answer 1

0

You cannot redirect FTP traffic by the site's domain name because FTP does not run over HTTP. Fortunately there is WebDAV - a replacement for FTP which does runs over HTTP. WebDAV just is a standard but many web servers implement it. For example Apache has mod_dav.

It seems that using Nginx is a bit complicated for proxying WebDAV: http://blog.agoragames.com/2009/03/20/webdav-nginx-play-nice/

I did it with Pound (an HTTP front-end) and it was simple.

Here is how my Pound config file looks.

# WebDAV
ListenHTTP

  Address mylab.edu
  Port    818

  xHTTP     3

  Service
    HeadRequire "^Host: anotherlab\.edu:818$"
    BackEnd
      Address openvzhost1
      TimeOut 60
      Port    818
    End
  End

  Service
    HeadRequire "^Host: anotherlab2\.edu:818$"
    BackEnd
      Address openvzhost1
      TimeOut 60
      Port    818
    End
  End
End

Don't run the FTP server on the head node. That's probably not very secure.

The best practice is not to run any services on the OpenVZ head node.

You must log in to answer this question.

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