Apache Virtual Hosts: Document Root as remote IP instead of local folder

0

I was wondering if I could point say ftp.foo.com to like 192.168.1.76 using Document Root. I have two servers, one contains all of the Apache2 stuff, the other, my downloads server. Could I route HTTP port 80 to my webserver, and using virtual hosts, map ftp.foo.com to 192.168.1.76, but still have www.foo.com direct to my website.

Thanks!

Keaton

Posted 2013-01-24T03:59:10.980

Reputation: 23

Are you behind a router or is this a vps setup? – John Siu – 2013-01-24T05:11:26.563

Answers

0

I am assuming you are behind a NAT router and only have 1 static external IP.

FTP and HTTP use different port. All you need to do is forward http/https to your web server, forward ftp to you ftp server. This is done on the router.

You do not need a virtual host setup on apache.

John Siu

Posted 2013-01-24T03:59:10.980

Reputation: 4 957

I would rather not use my public IP to access my downloads server – Keaton – 2013-01-24T15:44:56.940

(1) Is my assumption about the router correct? (2) In that case you may want to use Ziaunys suggestion, mod_proxy_ftp. However, it does not support ftp upload. Additionally, that also means all ftp traffic will pass through your web server box. (3) Is there a specific way you want this ftp server to be used? Maybe briefly describe the situation in the question, we maybe able to suggest some alternatives. – John Siu – 2013-01-24T15:54:23.223

0

You probably want to use apache as a proxy to your ftp server. It has a "mod_proxy_ftp" feature you can enable. This way you can just use your ftp.foo.com cname to match the proxy vhost. Here's a link to the documentation:

http://httpd.apache.org/docs/2.2/mod/mod_proxy_ftp.html

Ziaunys

Posted 2013-01-24T03:59:10.980

Reputation: 31