在Windows Azure虛擬機器中部署FileZilla (no coding)

來源:互聯網
上載者:User

Once you’ve setup a virtual machine in windows azure, you are likely need to transfer files between your local machine and the virtual machine in the cloud. You may need to upload software, tools or even database files to the VM.

The most convenient way to do that is to have a FTP server on the VM, so you can do uploading and downloading from anywhere.

However, set up a FTP server in the cloud is not as easy as it looks like. The key challenge is that FTP sessions need to establish two connections to transfer a file:

  • Control connection. Used to send control between server and client. Established when client connect to server on port 21;
  • Data connection. Used to transfer files. In active mode, client randomly picks a port and server will make the connection; in passive mode, server randomly picks a port, and client makes the connection.

As you know, VM does not have public IP address, to make the virtual machine accessible from outside of cloud, you need to create an endpoint for each port you want to connect, to forward the port from public gateway to your VM.

That means, if you want to connect to port 21 of the VM, you need to create an endpoint in the windows azure portal, to forward port 21 to vm’s port 21. That’s relative easy, what’s difficult is the data channel, because we don’t know the exact ports beforehand.

So we have to limit the ports that FTP server uses for data channel to a small range, and for each port in the range, create an endpoint, so that client and server can establish the data connection.

Also, don’t forget firewall. Make sure the firewall on the server allows connection on the ports (21 and ports for data channel).

Below are the detailed steps (by default the actions are done on windows azure virtual machine, not your local machine):

1, Download FileZilla server from http://filezilla-project.org/download.php?type=server;

2, Install FileZilla server, accept all the default options;

3, Add a user

3.1 Launch FileZilla Server interface;

3.2 go to menu Edit->Users;

3.3 Click the Add button in the users group on the right side;

3.4 Select Shared folders in the Page group, on the left;

3.5 In the Shared folders, click the Add button, select a folder that ftp user can access;

3.6 Click OK to close the dialog;

More info http://wiki.uniformserver.com/index.php/FileZilla_Server:_Basic_Configuration

Now you should be able connect to the FTP server from within the Virtual Machine, use the user you just created.   But it’s not accessible outside of the VM, like from your desktop.

4, Configure firewall to allow “FileZilla Server.exe”, not “FileZilla Server Interface.exe”, through;

5, Configure your virtual machine to allow ftp connection

5.1 Go to your windowsazure.com portal;

5.2 Select your virtual machine, and click ENDPOINTS on the top;

5.3 Click ADD ENDPOINT button on the bottom;

5.4 Put following parameter in to popped dialog

NAME:<whatever you want>

PROTOCAL:TCP

PUBLIC PORT:21

PRIVATE PORT:21

More info http://www.windowsazure.com/en-us/manage/windows/how-to-guides/setup-endpoints/

Now you should able to log in to the FTP server from anywhere, but still unable to retrieve directory listing, because you can’t establish the data connection.

6, Configure data channel port in FileZilla server

6.1 Launch FileZilla Server Interface;

6.2 Go to menu Edit->Setting;

6.3 Select Passive mode setting on the left

6.4 check “Use custom port range”, and input a port number greater than 1024 for both low and high number, let’s say put 60000. (Limit the port range because we don’t want to create hundreds or thousands of ENDPOINT in windowsazure portal);

6.5 Click OK to close the dialog;

7, Configure firewall to allow inbound connection from the port Configured in step 6;

8, Add another ENDPOINT in the windowsazure portal for the data channel port you configured in step 6, parameters:

NAME:<whatever you want>

PROTOCAL:TCP

PUBLIC PORT:60000

PRIVATE PORT:60000

9, In the IPv4 specific group, select Retrieve external IP address from:

filezilla_passive_setting

Done!

Note: windows command line ftp.exe does not support passive mode, so recommend FileZilla client to connect from outside of the virtual machine.

原文地址:http://huberyy.wordpress.com/2012/08/03/set-up-a-ftp-server-in-windows-azure-virtual-machine-with-filezilla-no-coding/

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.