Your EC2 Instance
How to Connect to your EC2 Instance?
Connect from Unix/Linux/Mac You would need the key you downloaded EC2]$ chmod 400 MyKeyPair.pem EC2]$ ssh -i MyKeyPair.pem west-2.compute.amazonaws.com
Connect EC2 Instance from Windows On your computer, please download PuTTY,PuTTYgen, and Psftp from On your computer, please download PuTTY,PuTTYgen, and Psftp from
Convert the KeyPair associated with your instance from.pem file to.ppk file by using PuTTYgen Convert the KeyPair associated with your instance from.pem file to.ppk file by using PuTTYgen 1. Load you.pem file 2. Save it as.ppk file
Then use PuTTY to ssh your EC2 instance Then use PuTTY to ssh your EC2 instance Public DNS of your EC2 instance
Load the.ppk file
You can save your configuration for next use Then click “Open”
Login as ec2-user
Part II: Install Apache HTTP Server on your Instance Part II: Install Apache HTTP Server on your Instance
Connected to EC2 instance Check software package installed Check software package installed yum list installed yum list installed | more
Update all your currently installed package Update all your currently installed package sudo yum –y update sudo yum –y update
Install lynx – a text based browser Install lynx – a text based browser sudo yum install lynx sudo yum install lynx Install C++ compiler Install C++ compiler sudo yum install gcc sudo yum install gcc Install make Install make sudo yum install make sudo yum install make Install httpd Install httpd sudo yum install httpd sudo yum install httpd sudo service httpd start sudo service httpd stop sudo service httpd restart
Test Your Web Server
Part III Transfer files from and to your EC2 Instance Part III Transfer files from and to your EC2 Instance
Transfer from/to your Unix/Linux/Mac $ cd ~/.ssh create a file named “config”, add the following two lines to this file: (If this file already exists, add the following two lines to the end of the file) host ec compute-1.amazonaws.com identityFile ~/Keypairs1.pem Public DNS of your EC2 Your Keypair file
Use sftp to connect to your EC2 Upload file download file Ends sftp ~]$ sftp Connecting to ec us-west-2.compute.amazonaws.com... sftp> put MyKeyPair2.pem Uploading MyKeyPair2.pem to /home/ec2-user/MyKeyPair2.pem MyKeyPair2.pem 100% KB/s 00:00 sftp> get try.txt Fetching /home/ec2-user/try.txt to try.txt /home/ec2-user/try.txt 100% 6 0.0KB/s 00:00 sftp> bye ~]$
Transfer file from/to Windows Open PuTTY, save the session of the connection to your EC2 Open PuTTY, save the session of the connection to your EC2
Open the session List the files under the current direction on EC2 Change directory on EC2 Upload file Close the session