Amazon EC2 instance setup

Creating an Amazon EC2 instance
  1. Install elasticfox plugin for firefox.
  2. Start elasticfox by clicking on the 'Tools' menu in Firefox then selecting 'Elasticfox'. Elasticfox will ask you to provide AWS Credentials, select 'Yes' at the first prompt then enter your AWS Account name, Access Key and Secret Access Key. Create or view your account's key by logging into amazon aws portal.
  3. Access key and Secret Access key can be found at Account->Security Credentials->Access Keys
  4. Once entered your Account Credentials click the 'Close' button. Check your access by Clicking on the 'Availability Zones' tab in Elasticfox. You should see several regions available. If you do not see any regions then close and restart Firefox and Elasticfox.
  5. Set up KeyPairs for the instances. These are used to connect to your AMI instance for administration purposes outside of Elasticfox. Click on the KeyPairs' tab, then on the Green, 'Create a KeyPair' button. Name the keypair  (for example: mykey1) and then save the file.
  6. Start a small EC2 instance. Choose instance based on the functionality required.  Click the 'Images' tab in Elasticfox then enter the AMI ID or enter any search term (ex: ingres)in the 'Images' text box. Click the AMI name to select it then click the 'Launch Instance' button.
  7. Accept default values and select the keypair just created. Click the 'Launch' button.
  8. Click on ‘Instances’ tab which lists all the instances under the account and the instance just created. The ‘State’ of the instance will show as pending for few minutes before going to running state.
  9. Double-click the instance from the ‘instances’ tab and copy the "Public DNS Name" entry.
Configure firewall settings
To change the security settings from Elasticfox on the 'Security Groups' tab.
  1. Create a new group or select the 'default' group in the left 'Your Groups' pane, and then click the 'Grant Permission' (green button) on the left side 'Group Permissions' pane of your browser window.
  2. To open port: (ex:1935) - choose 'HTTP' in the 'Protocol Details' dropdown, 'TCP/IP' as the Protocol and '1935' as the Port. Leave the 'Host' radio button selected and in the field next to it enter 0.0.0.0/0. Port 1935 will now be open in any new AMIs you launch in the 'default' security group.
  3. If port 1935 is already added in the group permissions it will prompt for error, on error prompt select ‘cancel’ 
Change the security settings to enable port 22 -- for connecting to instance using SSH
  1. Click the 'Grant permission' button in the right pane.
  2. In the dialog box that appears select 'SSH' from the 'Protocol Details' drop down and 'TCP/IP' as the 'Protocol'. Leave the port as '22'. In the 'Host/Network Details' section enter 0.0.0.0/0 as 'Host' then click the 'Add' button.
Change the security settings to enable port 8080 – for web client on tomcat web server
  1. Click the ‘Grant permission’ button in the right pane.
  2. Choose 'HTTP' in the 'Protocol Details' dropdown, 'TCP/IP' as the Protocol and '8080' as the Port. Leave the 'Host' radio button selected and in the field next to it enter 0.0.0.0/0. Port 8080 will now be open in any new AMIs you launch in the 'default' security group.

Connecting to instance
  1. Download putty.exe and puttygen.exe.
  2. Run the puttygen.exe tool, click the “Load” button and select the .pem key file(If the pem is not listed in the directory select ‘All Files’ from the drop down) that is created and saved earlier,  enter file name and click the “Save private key” button and save the key.
  3. Right click on the running instance in the Elasticfox and click ‘Connect to Instance’. Select the ‘.ppk’ file created in the previous step to open instance shell.

1 comment:

Please leave a comment related to the post.