Amazon EC2 : Connect to server using Putty

Amazon EC2 : Connect to server using Putty

Read our previous post : HOW TO CREATE AND CONFIGURE AMAZON EC2 FREE TIER ACCOUNT 

Generate the private key from the pem file

  1. To connect to Amazon server using Putty you need to have .ppk file. This can be generated from the .pem file which you have downloaded while creating the instance.

Open the puttygen.exe (if you don’t have please download from the net http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html ) to create the .ppk file from the .pem file.

Open the puttygen

a) Click on the load and load the pem (make file type as All) file.

Give the passphrase and confirm it. Then click on the save private Key.

putty key generator
putty key generator

 

Login to amazon linux box using putty

b) Now open the putty provide all the details as mentioned below

HostName : your amazon instance address (Public IP) or Public DNS

Port: 22

Go to Auth and give the private key file path.

Go to Data and provide the defaulr user: ec2-user

Amazon EC2 Putty login
Amazon EC2 Putty login

 

Amazon EC2 Putty Configuration
Amazon EC2 Putty Configuration

 

c) Click on Open in putty. It will ask for passphrase to enter provide the passphrase which you have entered while generating the private key.

After successful login you should be able to see this

SSH Login to Amazon EC2
SSH Login to Amazon EC2

 

Now you are successfully logged into Amazon ec2 box. Welcome to the amazon Linux box

Installation of Apache in the Box

  1. The amazon linux box will come with default java. No need to install separately (if you want you can install the other version of java)

To check the directory of java use the below command

 

1.	 The amazon linux box will come with default java. No need to install separately (if you want you can install the other version of java)
To check the directory of java use the below command
echo ${JAVA_HOME}

2.	You can install the Apache tomcat using the below command
sudo service tomcat7 start
	Or you can also copy paste the apache into some specific path using winzip
	Create directory share/tomcat/ inside /usr. 
	Copy the Apache from your local drive to usr/share/tomcat directory
3.	You can install the web-server using the below command:
sudo yum groupinstall -y "Web Server".
Use the below command to start and stop the webserver:
sudo service httpd start and sudo service httpd stop
4.	Deploy the war file into the WebApp folder in the apache tomcat then start the tomcat.
Access the application using the http://PublicIPAddress:8080/ApplciationName

Some usefull links and commands regarding setting up the your amazon server

Amazon EC2 mysql configuration
Amazon EC2 mysql configuration

http://www.excelsior-usa.com/articles/tomcat-amazon-ec2-advanced.html#port80