Amazon EC2

Table of Contents

Table of Contents


Introduction

This tutorial covers deploying an ICEfaces application to an Amazon EC2 instance running an application server. Amazon's EC2 stands for Elastic Cloud Computing and is described by Amazon as:

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers.


Requirements

This tutorial assumes the following requirements are met before continuing:

  • Amazon account with Amazon Elastic Cloud Computing enabled.
  • PuTTY and PuTTYgen (Windows only)


Amazon EC2 Instance

Creation

This tutorial offers 2 alternatives of creating a new instance:

In order to use either of the wizards the AWS Administration Console is required and can be found at https://console.aws.amazon.com/console/home.

Creating a New Instance with Classic Wizard

Using the AWS Administration Console:

  • Click on the EC2 tab.
  • Using the Navigation panel on the right, select the desired Region.
  • Using the Amazon EC2 Console Dashboard panel on the right, click on the Launch Instance button.
  • Using the Create a New Instance pop-up window:
    • Select the Classic Wizard radio button and click on the Continue button.
  • Using the Request Instances Wizard pop-up window:
    • Chose the desired Amazon Machine Image (AMI) (e.g. Ubuntu Server 12.04 LTS), select either the 64 bit or 32 bit radio button, and click on the Select button.
    • Enter the desired Number of Instances (e.g. '1'), select the desired Instance Type (e.g. Micro (t1.micro)), select the Launch Instances radio button, select the desired Availability Zone (e.g. No Preference), and click on the Continue button.
    • Select the desired Kernel ID (e.g. Use Default), select the desired RAM Disk ID (e.g. Use Default), tick the Monitoring checkbox if desired (additional charges will apply), tick the Termination Protection checkbox, select the desired Shutdown Behavior (e.g. Stop), and click on the Continue button.
    • Add desired Tag_s to the instance (e.g. with _Key 'Name' and Value 'ICEsoft Application Server') and click on the Continue button.
    • Select the Create a new Key Pair radio button, enter the desired name for your key pair (e.g. 'ICEsoft_Key_Pair'), click on the Create & Download your Key Pair link and save the Key Pair to the desired location.
    • Select the Create a new Security Group radio button, enter the desired Group Name (e.g. 'ICEsoft_Security_Group'), enter the desired Group Description, select the Custom TCP rule from the Create a new rule combobox, enter '8080' as the Port range, enter the desired Source (e.g. '0.0.0.0/0'), enter the desired Name (e.g. 'Application Server'), click on the Add Rule button, and click on the Continue button.
    • Review the information and click on the Launch button.
  • Using the Launch Instance Wizard pop-up window click on the Close button.

Creating a New Instance with Quick Launch Wizard

Using the AWS Administration Console:

  • Click on the EC2 tab.
  • Using the Navigation panel on the right, select the desired Region.
  • Using the Amazon EC2 Console Dashboard panel on the right, click on the Launch Instance button.
  • Using the Create a New Instance pop-up window:
    • Select the Quick Launch Wizard radio button, enter the desired Name Your Instance (e.g. 'ICEsoft Application Server'), select the Create New radio button, enter the desired Name (e.g. 'ICEsoft_Key_Pair', click on the Download button, save the Key Pair to the desired location, select the desired Launch Configuration (e.g. Ubuntu Server 12.04 LTS), select either the 64 bit or 32 bit radio button, and click on the Continue button.
    • Click on the Edit details button.
    • Select the Security Settings radio button, select the Create new Security Group radio button, enter the desired Group name (e.g. _'ICEsoft_Security_Group'), enter the desired Group Description, select the SSH from the Create a new rule combobox, click on the Add Rule button, select the Custom TCP rule from the Create a new rule combobox, enter '8080' as the Port range, enter the desired Source (e.g. '0.0.0.0/0'), enter the desired Name (e.g. 'Application Server'), click on the Add Rule button, click on the Create button, and click on the Save details button.
    • Review the information and click on the Launch button.
    • Click on the Close button.

Connection

Connecting to the New Instance

Using UNIX/Linux

Using a terminal follow these steps in order to connect to the new instance:

  • Change the file permissions on the Key Pair file (e.g. 'ICEsoft_Key_Pair.pem') using the following single-line command:
    chmod 400 ICEsoft_Key_Pair.pem
  • Connect to the new instance with SSH using the following single-line command:
    ssh -i ICEsoft_Key_Pair.pem [user]@[hostname]
Tip
Please note that the placeholders [user] and [hostname] need to be replaced with the correct values. The user depends on the chosen Linux distribution (e.g. in the case of Ubuntu Server the user is 'ubuntu'. The hostname can be found using the AWS Management Console as follows:
  • Click on the EC2 tab.
  • Using the Navigation panel on the left, navigate to INSTANCES -> Instances.
  • Using the My Instances panel on the right, select the new instance (e.g. ICEsoft Application Server).
  • In the bottom right panel the hostname is listed as the Public DNS.

Using Windows

Using PuTTY and PuTTYgen follow these steps in order to connect to the new instance:

  • Using PuTTYgen:
    • Using the menu bar at the top, navigate to File -> Load Private Key.
    • Using the Load private key pop-up window, select the desired private key (e.g. 'ICEsoft_Key_Pair.pem') and click on the Open button.
    • Using the PuTTYgen Notice pop-up window, click on the OK button.
    • Using the menu bar at the top, navigate to File -> Save Private Key.
    • Using the PuTTYgen Warning pop-up window, click on the Yes button.
    • Using the Save private key as pop-up window, enter the desired File name (e.g. 'ICEsoft_Key_Pair.pkk') and click on the Save button.
    • Using the menu bar at the top, navigate to File -> Exit.
  • Using PuTTY:
    • Using the Category panel on the left, navigate to Connection -> SSH -> Auth.
    • Using the Options controlling SSH authentication panel on the right, click on the Browse button.
    • Using the Select private key file pop-up window, select the desired private key (e.g. 'ICEsoft_Key_Pair.pkk') and click on the Open button.
    • Using the Category panel on the left, navigate to Session.
    • Using the Basic options for your PuTTY session panel on the right, enter the desired Host Name (or IP address) and click on the Open button.
    • Using the PuTTY Security Alert pop-up window, click on the Yes button.

Installation, Configuration and Deployment

The new instance can now be treated as a virtual machine on which the desired application server (e.g. GlassFish Server, JBoss AS, Tomcat, etc.) can be installed and configured, on which the desired ICEfaces application can be deployed.


External Link

  • PuTTY and PuTTYgen [link]
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2021 ICEsoft Technologies Canada Corp.