2011-05-02 106 views
6

我想在我的亚马逊Ec2窗口实例上安装FTP服务, 我对此有一些疑问。如何在亚马逊Ec2上安装和配置FTP?

  1. 这是一个很好的FTP恶魔安装EC2实例上的Windows EC2服务。
  2. 我们可以像在窗口服务器上使用窗口CD一样安装FTP。
  3. 在Ec2服务器上的任何教程或视频的安装和配置FTp帮助我们?

请在这方面帮助我。谢谢

回答

5

Windows EC2实例都是Windows Server 2008.最简单的事情就是启用内置的FTP功能。

请参阅http://www.youtube.com/watch?v=QsGPqkobCs8

+0

这是帮助FUL – Arsalan 2011-05-02 11:16:02

+3

此外,因为这个问题是AWS为中心,不要忘记这一点:登录EC2管理控制台,转到安全组,选择实例所属的安全组,单击入站选项卡,创建新的自定义TCP规则,允许端口21.否则,上述视频方法将无法工作,因为亚马逊防火墙将覆盖Windows防火墙。 – Zeeshan 2013-06-24 20:15:37

+0

之后,我被卡在:'状态:\t服务器发送带有不可路由地址的被动回复。使用服务器地址instead.' '命令:\t LIST' '响应:\t 150打开二进制模式数据connection.' '响应:\t 550数据信道定时out.' '错误:\t无法检索目录listing' – Zeeshan 2013-06-24 20:19:54

9

在这里,您将找到一个很好的教程,解释您可能遇到的尝试在amazon EC2实例上设置ftp服务器的内部工作和问题。

这也解释了为什么只是打开亚马逊防火墙上的端口21不起作用。那里的例子使用免费的filezilla ftp服务器和客户端,但任何可以使用。

http://me-ol-blog.blogspot.com/2011/03/how-to-install-ftp-server-on-amazon-aws.html

编辑(24月 - 2013年):

因为对于计算器的最佳政策做法表示不依赖于链接,我复制从我的博客在这里的信息:

如何在Amazon EC2 AWS安装FTP服务器

This seems to be a big issue as people usually waste a lot of time on this. 

The problem lies with 2 elements: the security group settings & the ftp server settings. 

FTP is not considered a good solution for passing files between EC2 instances and your computer as it is not firewall "friendly" - you can't just open port 21/TCP on the amazon security group settings because the server is actually sitting on a NAT address and when an ftp client connects to an FTP server using PASV mode then the server tells the client which port and which address to use for the data stream (like directory listing). 

If you want an alternate easy solution for transferring files between yourself and the EC2 instance then setup a dropbox on both machines - it doesn't get easier than this... :) 

If you still want to set up an FTP server on your EC2 instance then read on... 

Typically, people just try to open port 21 and then try to connect and get something similar to: 

Status: Server sent passive reply with unroutable address. Using server address instead. 
Command: MLSD 
Response: 425 Can't open data connection. 

The solution is (and for this example I will explain how to perform the setting on FileZilla FTP server on windows): 

1. FileZilla FTP server: Edit-> settings -> Passive mode settings: 
(x) Retrieve external IP from: 
     http://ip.filezilla-project.org/ip.php 
[ this tells the ftp server to perform a 'whatismyip' and give that to the ftp client, you can also specifically put the address DNS name you use in your remote desktop in the "Use the following IP:", e.g., ec2-6-100-129-60.compute-1.amazonaws.com ] 

(x) Use custom port range: 
1024-1048 

[ these are the ports that will be given to the ftp client - we will open them in the following step in the Firewall ] 

2. Amazon security groups: open ports - 
    a. Custom TCP rule , Port range:21 
    b. Custom TCP rule, Port range:1024-1048 

3. Turn off the windows firewall on the EC2 machine (you don't need it - you have the amazon firewall) 

That's it, and just as side note, you don't need to use Elastic IP feature for this to work. 
Also don't forget to set your client to use PASV mode (which is typically the default). 

You can verify this works by reading the answer the server gives the client when it enters PASV mode: 

Command: PASV 
Response: 227 Entering Passive Mode (174,149,71,102,4,7) 

This response means: "Yo FTP client, use 174.149.71.102 and port 4*256+7=1031"