Thursday, August 04, 2011

How to setup LAMP in AWS (Amazon Web Services - EC2) using Putty

Im going to skip very basic steps. Is you do not have any idea how to get to the screen below this is not for you.
1.) Click "Launch Instance"

2.) Select "SUSE Linux Enterprise Server 11 64-bit (AMI Id: ami-e4a3578d)
SUSE Linux Enterprise Server 11 Service Pack 1 basic install, EBS boot, 64-bit architecture with Amazon EC2 AMI Tools preinstalled; Apache 2.2, MySQL 5.0, PHP 5.3, Ruby 1.8.7, and Rails 2.3.
Root Device Size: 15 GB" from the options. (thats what i did)

PS: If you select SUSE you have to pay. Later I selected "Amazon Linux AMI", which is free for 750hr per month. If you use Amazon Linux later the user name to login is "ec2-user".

3.) For now dont change the following screen. Once you become good at this you can create once with better configurations. And I think you need to pay more when its getting better. Just click "Continue"

4.) Again you will be shown with some details like "Kernal ID" and "Ram disk ID". Dont waste time. Just click "Continue"

5.) Next screen it ask you to enter some keys. They have already given a key as name. For now just type what ever name you like in the value box and click "Continue"

6.) Now you need to create a key pair. Select the 2nd option ("Create a new Key Pair"). Enter a name for your key. When you click create and download your browser will save a file with extension ".PEM". Keep it. We will need it for future. Once you have the file click "Continue" to get to next step.

7.) Next it will ask for security groups. Just add one with full access. I know its bad. But if you need more instructions in setting up better security options read some where else for that.

8.) Finally the "Launch". Now the system starts running your instance.

9.) When you click "Instances" in left menu you will find your server is now running.

10.) One more thing we need to do. Go to "NETWORK &SECURITY -> Elastic IP" option in left menu. Then find the button which says "Allocate New Address". Select "EC2" since we are working on it. And you will start seeing an IP address allocated for you. Its not a public IP for you. So dont be soo happy.

11.) Next right click on the IP address shown. Then you'll get the option to Associate the created server into it. Do it. Now you should get a "Public DNS" name for that given IP. This is the address where you can access your server. But for me when i try this on browser it didnt show up anything. I needed to install Apache, MqSQL and PHP first.

12.) Now the BUGGY part. Accessing server through SSL connection using Putty. 1st download both Putty and PuttyGen.  Open PuttyGen 1st. Then Click "Load" to load an existing private key. And locate the PEM file you saved. And open it. And in the screen for parameters its selected to SSH2 as default. But select SSH1.  Next save the private key. It will save as a PPK file.

13.) Now open putty
Now enter the public DNS given for you from the AWS as the Host name ( Remember ! IT IS NOT the Elastic IP). Goto Connection->SSH->Auth. Give the location of PPK file created using puttygen. It needs to be a SSH1 type file. Now clikc open.

14.) Server will ask you for the username. It is "root" and once you enter that you are logged in. When im reading through some other documents they have mentioned to try "ec-user" as username. If any case root do not work try that.

Upto here i only talks about setting up a SUSE Linux server on AWS EC2. Read here to find about how to install LAMP to SUSE. Whether it says in the selection it has LAMP, it really does not have it in installation. But its very easy to set up.

1 comment:

Blogger said...

Bluehost is definitely the best web-hosting company with plans for all of your hosting requirments.