{"id":212,"date":"2011-02-13T20:47:48","date_gmt":"2011-02-14T01:47:48","guid":{"rendered":"http:\/\/www.compdigitec.com\/labs\/?p=212"},"modified":"2011-02-13T20:47:48","modified_gmt":"2011-02-14T01:47:48","slug":"setting-up-a-proftpd-port-based-virtualhost","status":"publish","type":"post","link":"http:\/\/www.compdigitec.com\/labs\/2011\/02\/13\/setting-up-a-proftpd-port-based-virtualhost\/","title":{"rendered":"Setting up a ProFTPd port-based VirtualHost"},"content":{"rendered":"<p><a href=\"http:\/\/www.proftpd.org\/\">ProFTPd<\/a> is a very powerful FTP server software that is most commonly used on Linux servers to provide a FTP service to the public, Intranet or Web Services. ProFTPd, much like its HTTP counterpart, Apache, contains the ability to host multiple different services on one physical computer by using &#8220;Virtual Hosts&#8221;, which makes it appear as it were multiple hosts hosting different content. Unfortunately, FTP does not support named-based virtual hosting like HTTP does, so to allow customers\/clients to be able to FTP you must use a different port.<\/p>\n<p><strong>Procedure<\/strong><\/p>\n<ol>\n<li>Open up your ProFTPd configuration file (by default it is <strong>\/etc\/proftpd.conf<\/strong>) using your favourite text editor:\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo nano -w \/etc\/proftpd.conf<\/pre>\n<\/li>\n<li>Add a VirtualHost. The following snippet sets up a &#8220;virtual&#8221; server on Port 3003 for all bound IP addresses (<strong>IPv6<\/strong> and <strong>IPv4<\/strong>). You can change the 3003 to the port you want to host, change the ServerName to a useful description of the host and DefaultRoot to the root of the FTP.\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;VirtualHost ::0.0.0.0&gt;\r\n\tPort 3003\r\n\tUmask 022\r\n\tServerName &quot;VirtualHost FTP&quot;\r\n\tDefaultRoot \/home\/www\/customer3003\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<\/li>\n<li>If you do not want <strong>IPv6<\/strong> support or it gives you problems on your specific host, then you can bind it to all <strong>IPv4<\/strong> addresses on Port 3003 (same as above otherwise):\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;VirtualHost 0.0.0.0&gt;\r\n\tPort 3003\r\n\tUmask 022\r\n\tServerName &quot;VirtualHost FTP&quot;\r\n\tDefaultRoot \/home\/www\/customer3003\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<\/li>\n<li>If you want, you can also modify it to bind to only certain ports to the specified port. When you are comfortable with your configuration, save the file and exit.<\/li>\n<li>Reload the FTP server and connect away:\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo \/etc\/init.d\/proftpd restart<\/pre>\n<\/li>\n<\/ol>\n<p><b>What did not work<\/b><\/p>\n<ul>\n<li>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;VirtualHost *&gt;\r\n\tPort 3003\r\n\tUmask 022\r\n\tServerName &quot;VirtualHost FTP&quot;\r\n\tDefaultRoot \/home\/www\/customer3003\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<\/li>\n<li>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;VirtualHost&gt;\r\n\tPort 3003\r\n\tUmask 022\r\n\tServerName &quot;VirtualHost FTP&quot;\r\n\tDefaultRoot \/home\/www\/customer3003\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<\/li>\n<li>and\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;VirtualHost All&gt;\r\n\tPort 3003\r\n\tUmask 022\r\n\tServerName &quot;VirtualHost FTP&quot;\r\n\tDefaultRoot \/home\/www\/customer3003\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>ProFTPd is a very powerful FTP server software that is most commonly used on Linux servers to provide a FTP service to the public, Intranet or Web Services. ProFTPd, much like its HTTP counterpart, Apache, contains the ability to host multiple different services on one physical computer by using &#8220;Virtual Hosts&#8221;, which makes it appear [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[259,749,746,745,748,747],"_links":{"self":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/212"}],"collection":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":0,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/212\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/media?parent=212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/categories?post=212"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/tags?post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}