amazon aws workshop (for beginners)

21
Amazon AWS Workshop Ryan Byrd

Upload: punkgenius

Post on 20-Jun-2015

332 views

Category:

Technology


1 download

DESCRIPTION

Amazonm, AWS, EC2

TRANSCRIPT

Page 1: Amazon AWS Workshop (For Beginners)

Amazon AWS WorkshopRyan Byrd

Page 2: Amazon AWS Workshop (For Beginners)

Agenda● Pre-Reqs● Cloud Computing FAQs● Signing up for an Amazon AWS account● Setting up an EC2 instance● Installing components

o PHP o Apacheo MySql

● Installing a code editor (IDE)● Moving files to your EC2 instance● Testing your web page

Page 3: Amazon AWS Workshop (For Beginners)

Pre-Reqs: Software for this Workshop

The following applications will be needed for this workshop.● Filezilla

o Note: Make sure you only install filezilla. You may be prompted to install other applications with the install. Click “Decline” to skip other offerings.

● Windows Only:o Puttyo Puttygen

Page 4: Amazon AWS Workshop (For Beginners)

Pre-Reqs: The Basics of the Internet and the World Wide Web

● The Internet is a global network which links computers together

● The World Wide Web runs on the Internet and serves up web pages from servers to clients using HTTP.

● a WWW Client is browser software like IE, Firefox, Chrome, or Safari.

● WWW Servers (“web servers”) are computers that sit in a data center listening for and responding to client requests.

Page 5: Amazon AWS Workshop (For Beginners)

Pre-Reqs (2)

● The HTTP protocol is the language that WWW clients/browsers speak to web servers. HTML is sent over HTTP.

● HTML is the markup language that describes text and accompanying media of a web page

● Ports are a way of segmenting traffic based on purpose. Port 80 means standard web pages and 443 means encrypted web pages, for example.

● Firewalls block traffic based on Ports and IP Addresses● Web Server Software is the server software that

responds to client requests by serving up web pages, e.g. Microsoft IIS or Apache.

Page 6: Amazon AWS Workshop (For Beginners)

Cloud FAQs

Q. What is “the Cloud?”

A. Large companies (like Amazon and Google) built large server farms (which are data centers with web servers) and they provide access to a virtual server that runs on these servers for a fraction of what it would have cost you to buy a server and put it into a data center.

Page 7: Amazon AWS Workshop (For Beginners)

Cloud FAQs (2)

Q. What is the alternative to cloud computing/virtual machines?

A. Before the advent of the cloud, it was necessary to buy or lease a server in a data center to run a dedicated web server.

Page 8: Amazon AWS Workshop (For Beginners)

Cloud FAQs (3)

Q. What are the advantages of cloud computing?

A. With the cloud, you pay as you go, often per hour, with no or little up-front costs.

Page 9: Amazon AWS Workshop (For Beginners)

Cloud FAQs (4)

Q. Who are the Cloud computing providers?

A. Amazon, Google, Rackspace and Digital Ocean are examples of Cloud computing providers.

Page 10: Amazon AWS Workshop (For Beginners)

Cloud FAQs (6)

Q. What is a database?

A. A database is like many linked spreadsheets in which you can look up data.

Page 11: Amazon AWS Workshop (For Beginners)

Cloud FAQs (7)

Q. How much does it cost to have a virtual computer in the cloud?

A. Depending on the type of server, you can pay pennies or dollars per hour. Some companies allow you to use a virtual server for free to test it out (Amazon's "Free Tier")

Page 12: Amazon AWS Workshop (For Beginners)

Cloud FAQs (8)Q. What is AWS? EC2? AMI?

A. Amazon Elastic Compute Cloud(EC2) is a central part of Amazon.com's cloud computing platform (called Amazon Web Services.) EC2 allows users to rent virtual computers on which to run their own computer applications. Amazon Machine Image (AMI) is a preconfigured operating system with virtual application software that is used to create a virtual machine within the Amazon Web Services' AWS EC2

Page 13: Amazon AWS Workshop (For Beginners)

Amazon AWS - get an account

1. Go to http://aws.amazon.com 2. Enter your email address and choose “I am a new user.”3. Go to the sign in screen and enter your user

information.4. Enter your contact information.5. Provide Payment Info (you will not be charged).6. Verify your phone number.7. Choose your support plan “Basic (Free)”.8. Trouble? http://youtu.be/WviHsoz8yHk

You now have an Amazon AWS account!

Page 14: Amazon AWS Workshop (For Beginners)

Setting up an EC2 instance

1. Log into AWS, click EC2 under Services, EC2 Dashboard

2. Click Launch Instance button3. Choose an Amazon Machine Image (AMI)

that is “Free tier eligible”a. Choose Ubuntu Server 14.04 LTS, 64 bit

4. Click Review and Launch5. Create and download a new key pair6. Click Launch7. Trouble? http://youtu.be/SKM0BB0F02Q

Page 15: Amazon AWS Workshop (For Beginners)

Prepping your EC2 Instance

1. View Instances a. Wait for the instance state to change from pending

to running (~ 3 minutes)

2. Scroll to the right and click on the Security Group for your Instancea. Click inbound, click edit b. Add

i. HTTP (port 80, TCP, anywhere) ii. Ensure SSH (port 22, TCP, anywhere is also set)iii. Save

Page 16: Amazon AWS Workshop (For Beginners)

Installing Components, Windows

1. Download Puttygen to convert your .pem private key file to a .ppk file: http://goo.gl/LNNlCm

2. Download Putty to connect to your instance over SSH. http://goo.gl/OMaFjR

3. Then launch Putty and connect over ssh to your instance as user ubuntu, with the .ppk private key you just createda. From the instances view highlight your Ubuntu

instance and you can find the Public DNS in the description tab.

Page 17: Amazon AWS Workshop (For Beginners)

Installing Components, Mac

1. Open Terminal and run:a. cd ~/Downloads/b. chmod 400 my-key-pair.pemc. ssh -i my-key-pair.pem

[email protected]

Page 18: Amazon AWS Workshop (For Beginners)

Installing LAMP

1. sudo apt-get update 2. sudo apt-get install lamp-server^ It’s important to

remember the caret (^) at the end of the command. 3. sudo adduser ubuntu www-data 4. sudo chown -R www-data:www-data

/var/www 5. sudo chmod -R g+rw /var/www 6. LOG OUT (exit) 7. LOG IN

FYI: LAMP = Linux, Apache, MySQL and PHP

Page 19: Amazon AWS Workshop (For Beginners)

Testing

1. nano /var/www/html/index.php a. <?php echo("hello world"); ?>b. NOTE: the “ ^ “ in the nano editor means CTRL.

2. Test by hitting the domain name in a browser: http://YOURINSTANCE.compute-1.amazonaws.com/index.php

Page 20: Amazon AWS Workshop (For Beginners)

Moving Files to EC2

1. Download & Install filezillaa. Note: Make sure you only install filezilla. You may be

prompted to install other applications with the install. Click “Decline” to skip other offerings.

2. Load your .ppk private key into filezillaa. MAC: File->Preferences->SFTP->add keyb. Windows: Edit->Settings->SFTP->ddd key

3. Connect via SFTP using username ubuntu4. Document root is /var/www/html

Page 21: Amazon AWS Workshop (For Beginners)

Creating Your Webpage

1. Choose a nice PHP editor (IDE) that provides syntax highlightinga. MAC: sublimeb. Windows:

i. Notepad++ii. sublimeiii. NetBeans