This tutorial helps you understand how you could launch an EC2 instance quickly with FTP and SQL Server remote connectivity.
Note: No method in this tutorial is considered safe and secure. This is just a basic tutorial which will help you setup an EC2 instance quickly, you would probably want to dump this instance in most cases or enhance your security parameters if you plan to continue using the created instance.
Launch an instance
- Login to your Amazon EC2 Account
- Click on Launch Instance
- Select an Instance from the Quick Start tab. Since we are configuring a windows server, we will select Microsoft Windows Server 2008 R2 with SQL Server Express and IIS
- In the next tab, select number of instances, Availability Zone. Remember that EBS volumes may not be available across zones and Instance Type
- Accept default values in next tab and click on Continue
- The next tab (“Create new Key Pair”) is more important because you will be retrieving Windows Administrator password using the Key Pair file you are creating in this tab. You could skip this tab if you already have an existing Key Pair File
- From the Configure Firewall Tab, create a security group name and continue. Just make a note of the default port rules setup, we will extend this settings for Filezilla server later
- Launch the instance
Setting up Remote Desktop Protocol(RDP)
- For connecting to your instance using RDP , you will need to retrieve Administrator password of the instance. For this, select the instance from the Running instances list in EC2 console and select Get Windows Password. You will need the Key Pair file created earlier to decrypt the Administrator password. You may have to wait upto 15 minutes to get Administrator password of a fresh instance
Configuring and Enabling Remote Connectivity in SQL Server ( EC2)
- Connect to instance using RDP.
- By default, the SQL Server Related Services are not enabled and not set to start automatically in Large Instance with SQL Server Express. So you will have to enable SQL Server, SQL Agent and SQL browser services and make them start automatically from control panel
- Try connectivity to SQL express from the SQL Server management studio available in the instance. You could use windows Authentication. You will have to browse for the server name and wait for some time till the list of servers are retrieved.
- Enable login for SA, set a password and try login with SA using SQL server authentication
- Allow SQL Server to accept incoming connections using Windows Firewall-> Allow a program or Feature through this firewall. The SQL Server Express executable (sqlservr.exe) will be probably located in C:\Program Files\Microsoft SQL Server\MSSQL10_50.EC2SQLEXPRESS\MSSQL\Binn
- Start SQL Server Configuration manager
- Select SQL Server Network Configuration
- Enable TCP/ IP
- Right click on TCP / IP Properties (“IP Addresses”)
- In the property sheet , select last Section “IPAll”
- Remove any text set against “Dynamic Ports”
- Set 1433 against TCP Port (This port needs to be added as a custom rule for the security group of this instance. As you have seen in the Launch Instance stage, this is automatically done by EC2)
- Try connecting from a remote machine now. The server name is just the public DNS of this instance (or an IP address if you have attached an Elastic IP address to this instance)
Configuring and Enabling FileZilla FTP Server (EC2)
- Connect to instance using RDP.
- Download File Zilla Server version
- Install Filezilla. Select default values during installation
- Start FileZilla server. (First time you may have to set an administrator password)
- Select Edit -> Settings
- Select Passive Mode Settings
- Enable Use Custom Port Range and give values 1024 and 1048. (These ports needs to be added as a custom rule for the security group of this instance).
- Also enable reteieve external ip address from …
- Allow Filezilla server to accept incoming connections using Windows Firewall-> Allow a program or Feature through this firewall. The Filezilla server executable (FileZilla server.exe) will be probably located in C:\Program Files (x86)\FileZilla Server
- Add 21(FTP port) under Custom TCP Rule in Security Group of the instance in Amazon EC2 console.
- Add 1024-1048 under Custom TCP Rule in Security Group of the instance in Amazon EC2 console
- Create a user name and password from File zilla server interface and try connecting with this information from a remote machine. The ftp host is just the public DNS of this instance (or an IP address if you have attached an Elastic IP address to this instance)