Amazon AWS Final 3 PDF
Amazon AWS Final 3 PDF
Amazon AWS Final 3 PDF
Table of Contents
Introduction Part 1: Amazon EC2
What is an Amazon EC2? Services Highlights Other Information
Setting up a crossdomain.xml
Part 8: Wordpress
What is a Wordpress? Advantages of using Wordpress Installing a Wordpress
Configuring Wordpress
1
Amazon EC2
What is an Amazon EC2?
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed for web-scale computing easier for developers.
Service Highlights
Elastic Amazon EC2 enables you to increase or decrease capacity within minutes, not hours or days. You can commission one, hundreds, or even thousands of server instances simultaneously. Completely Controlled Flexible You have the choice of multiple instance types, operating systems, and software packages. Amazon EC2 allows you to select a configuration of memory, CPU, instances storage, and the boot partition size that is optimal for your choice of operating and application. You pay for a very low rate for the compute capacity you actually consume.
Inexpensive
Other Information
Login Access Amazon login access doesnt need any secret key Just your ordinary Amazon account
Buckets - Are simply folders in Amazon S3 Server. - If you want to access a certain file in the bucket you can use this URL: o http://[bucket].s3.amazonaws.com/[filename] - It is important to note that the bucket name is at the beginning of the URL. Instances Also know as Virtual Machines / Virtual Servers You have the ability to launch multiple Instances (Virtual Machines)
Steps on Creating Instances (on AWS Console) Click on "Launch Instances" button First, we'll select an Amazon Machine Image (AMI's) Second, Select Instance Third, Create Key Pair Fourth, Firewall Configuration Fifth, Launch Instance. Done.
2
Amazon Instances
What is an AMI?
An Amazon Machine Image (AMI) is an encrypted machine image that contains all information necessary to boot instances of your operating system and software. For example, an AMI might contain all the software to act as a web server (e.g. Linux, Apache, and web site). The Amazon EC2 Environment is a virtual server. Each machine or server is represented by a file called AMI - a bundle of preconfigured operating system and possible applications software that will run on EC2 Environment.
Failed or Terminated Instance Failed or Terminated Instance will automatically delete all the data in the Server. However, if an Instance fails or terminated that uses an Amazon EBS Volume as its root device, the data will remain available.
2) Choose an Amazon Machine Image (AMI) - a bundle of preconfigured operating system and possible applications software that will run on EC2 Environment.
3) Create a Key Pair - Very useful in connecting to Instance/Virtual Machine securely. Youll going to use this Key Pair later and Ill going to teach how t o use it using PuTTY or WinSCP. Just make sure you save this file in a secure place in your drive, you dont want to copy this by some else.
10
4) Configure Firewall o You can enable/disable ports on your Instance. o (Secure Shell) SSH - used in accessing Amazon Instance by the use of PuTTY, WinSCP, or other programs that are capable of connecting through the use of SSH protocol. o Hypertext Transfer Protocol (HTTP) enable this if you want your Instance be available on the internet. o MySQL enable this if you want to have access to your database
11
5) Finally, we are almost done. Click Launch button when youre done.
12
PuTTY is a client program for the SSH, Telnet and Rlogin network protocols.
These protocols are all used to run a remote session on a computer, over a network. PuTTY implements the client end of that session: the end at which the session is displayed, rather than the end at which it runs.
Download page http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY Application http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe PuTTY Key Gen http://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe
Source: http://clouddb.info/2009/05/26/using-and-managing-aws-part-6-ssh-key-pairs/
First things first Create PuTTY Private Key (.ppk) 1) You should have the copy of Key Pair (See Launching an Instance step 3 Creating a Key Pair) of your Instance. For our copy, we have tester-jonasblog.pem. 2) We need to convert this .pem file to .ppk using PuTTY Key Gen, so that our PuTTY can understand the file. See the ff steps below: a. Run PuTTY Key Gen b. Click Conversions at the Menu bar c. Click Import Key d. Select .pem file and then, click Open button
13
e. Imported Key is now converted, click File menu and then hit Save Private
14
15
4)
5)
16
6)
Login as: root You have now successfully logged-in to your Instance/Server
8 Steps to Connect Instance using WinSCP You can download WinSCP at http://winscp.net/eng/download.php. Click on Installation Package link, and then install the program. 1) Open WinSCP
17
18
19
3
Elastic Block Store (EBS)
Amazon Elastic Block Storage (EBS) is a new type of storage designed specifically for Amazon EC2 Instances. Amazon EBS allows you to create volumes that Amazon EC2 Instances can mount as devices much like a standard hard drive. Amazon EBS volumes behave as if they were raw unformatted external hard drives and can be formatted using a file system such as ext3 (Linux) or NTFS (Windows) and mounted on an EC2 instance; files are accessed through the file system .
20
4) Done
21
4
Connecting to Amazon S3
What is an Amazon S3?
Amazon S3 (Simple Storage Service) is storage for the internet. It is designed to make web-scale computing easier for developers. Amazon S3 allows you to store large amounts of data at a very low cost. Additionally, youll only pay the storage you have used.
Amazon
S3
Firefox
Organizer
plug-in
at
7 Steps on uploading a file and Editing its ACL Uploading file made easy with the help of S3 Firefox plug-in. You can use S3 Firefox Organizer plug-in to uploading, delete, and edit ACL of certain file in your S3 Server.
22
Go to Security Credentials under Your Account Tab, and Copy your Access Key ID & Secret Access Key
23
3) Add Account by click on Manage Accounts button Add any Account Name like paolo. You can specify any account name it wont matter. Insert Access Key ID & Secret keys from Security Credentials Page (refer step 1).
4) At this moment, you are now connected to the S3 server, then, select a file you wish to upload
24
6) Edit ACL
You have just successfully uploaded the file to the Amazon S3 Server, and Edited its ACL.
What is an ACL?
Each Bucket/Folder and Object/File on Amazon S3 has an ACL that defines its Access Control Policy. An ACL is a list of grants. A grant consists of one grantee and permission. ACL is a mechanism which decides who can access the Bucket/Folder or Object/File.
25
Creating a Bucket
1) Right Click on the right Panel and select Create Directory or Click the icon Create Bucket/Directory.
26
Crossdomain Policy
A cross-domain policy file is an XML document that grants a web client such as Adobe Flash Player, Adobe Reader, etc.permission to handle data across multiple domains. When a client hosts content from a particular source domain and that content makes requests directed towards a domain other than its own, the remote domain would need to host a cross-domain policy file that grants access to the source domain, allowing the client to continue with the transaction. Policy files grant read access to data, permit a client to include custom headers in cross-domain requests, and are also used with sockets to grant permissions for socket-based connections.
Setting up a crossdomain.xml Setting up crossdomain.xml is very useful if you want to play an *.swf or *.flv file, without crossdomain.xml youll have problem playing youre *.swf or *.flv file. If you encountered this kind of problem just simple follow the steps below.
1) Create a file crossdomain.xml and copy the xml source code below: <?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <allow-access-from domain="*.jonasblog.com" /> </cross-domain-policy>
27
2) Upload it to your root bucket or directory (see below) and make sure you Edit its ACL o http://[bucket].s3.amazonaws.com/crossdomain.xml o Check Everyone
28
5
Elastic IP Address
Elastic IP Address is a static IP address designed for dynamic cloud computing. An Elastic IP Address is associated with your account not a particular Instance, and you have full control on that IP Address. On traditional static IP Address, youll wait on for the technician to reconfigure or replace your host, or waiting for DNS to propagate to all of your customers, Amazon EC2 enables you to engineer around problems with your Instance or Software by quickly remapping your Elastic IP Address to a replacement Instance.
In the following image, web servers are connected to the Internet through elastic IP addresses and to database servers through their private IP addresses.
The administrator decides to replace a web server with a larger instance type. To do this, the administrator starts a new instance using a larger instance type (1), disassociates an elastic IP address from a running instance (2), associates the elastic IP address with the new instance (3), and terminates the old instance (4).
29
Amazon Elastic IP Address is free while they are assigned to an Instance, but they cost $0.01/hr if they are not assigned.
30
6
Installing Apache with PHP and MySQL (LAMP)
LAMP is short for Linux, Apache, MySQL, & PHP. I show you how to install Apache, MySQL, and PHP on your Linux server using putty. I assume you successfully log-in on your server using putty. 1) Check if httpd, php, or mysql is installed.
2) Install Apache
3) Install PHP
4) Install MySQL
31
6) Restart Apache
7) Done.
32
7
MySQL Database
A website that uses MySQL may include Web pages that access information from a database. These pages are often referred to as dynamic pages, meaning the content of each page is generated from database. Website that uses dynamic web pages is also known as databasedriven websites.
What is a MySQL?
MySQL is an open source Relational Database Management System (RDBMS) that relies on SQL for processing the data in the database. MySQL can be used for a variety of applications, but is most commonly used for web applications and for embedded applications and has become a popular alternative to proprietary database systems because of its speed and reliability. Connecting MySQL Server using PuTTY Login to your Instance using PuTTY if you forgot how to connect please refer to Part 2 Amazon Instance: 6 Steps to Connect Instance using PuTTY If youre logged in, please follow the steps below: 1) Type mysql, and it will prompt you to mysql environment. mysql> At this moment youre now connected to mysql server.
33
2) To show the list of existing databases. Type show databases. The databases information_schema, mysql, and test these are default databases.
34
Creating a Database using PuTTY 1) Log-in to your instance using PuTTY, and type mysql
35
4) Type show databases; again. Youll notice the database youve just created will appear on the list.
What is a phpMyAdmin?
phpMyAdmin is an open source tool written in PHP intended to handle the administration of MySQL over the World Wide Web. It can perform various tasks such as creating, modifying or deleting databases, tables, fields or rows; executing SQL statements; or managing users and permissions. Installing phpMyAdmin I assume that youre logged in to your Instance using PuTTY 1) Get a copy of phpmyadmin using wget: Wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.2.5/phpMyAdmi n-3.2.5-english.tar.bz2/download
36
6) If you encounter this error on your browser. Please proceed to step 7. If not, you have just successfully created a phpMyAdmin.
37
7) You have to change the chmod of your session folder: chmod 777 /var/lib/php/session/
38
8
Wordpress
What is a Wordpress?
WordPress is an open-source CMS designed for blogging, but easily modified to enable the management of an entire website. It is the most popular blogging tool in the internet today.
Ability to categorize your posts by topic, not just by date Ability to choose from hundreds of themes/skins Ability to integrate plugins Large user community with help forums Extensive documentation Ability to completely customize Wordpress code Ease of installation No ads Abililty to distribute podcasts with audio player plugins and a lot more..
39
40
Congratulation, you have now successfully unzip Wordpress software package unto your server.
Configuring Wordpress
1) Go to wordpress directory cd /home/webuser/helloworld/htdocs/wordpress 2) Copy-Paste and Rename wp-config-sample.php cat wp-config-sample.php >wp-config.php 3) Modify wp-config.php with the appropriate database config 4) Continue configuring Wordpress on your website at http://[your-website-address]/wordpress/
41
9
Domain Name
A domain name is the text name corresponding to the numeric IP address of a computer on the Internet. A domain name must be unique. Internet users access your website using your domain name. For instance Jonasblog.com, ReplaceMySelf.com and OnlineJobs.ph are all domain names.
What is a DNS?
DNS stands for Domain Name System. A DNS server lets you locate computers on a network or the Internet (TCP/IP network) by domain name. The DNS server maintains a database of domain names (host names) and their corresponding IP addresses. Jonasblog IP address, 174.129.221.146, corresponds to the DNS name www.jonasblog.com
What is a CNAME?
CNAME is short for Canonical Name. You should use a CNAME record whenever you want
associate a new subdomain to an already existing A record; i.e. you can make "www.somedomain.tld" to "somedomain.tld", which should already have been assigned an IP with an A record.
This allows you to have as many subdomains as you wish without having to specify the IP for every record. Use a CNAME if you have more services pointing to the same IP. This way you will have to update only one record in the convenience of a change of IP address.
42
1) Go to Advanced DNS Zone Editor Select the domain name you want to add a CNAME record. i.e. jonasblog.com
43
3) Select CNAME and add the S3 bucket name [yourbucketname].s3.amazonaws.com i.e. unique-bucket-name.s3.amazonaws.com
4) Click Add Record button 5) After you have submitted the form. Youll notice the
i.e. http://test.jonasblog.com/
44
Thank you.
45