Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Exercise 2: To access a virtual server in AWS, you need a key pair consisting of a private key and a
public key. Create a key pair.
(ELB) distributes traffic to a bunch of servers behind it. It’s highly available by default.
■ Elastic Compute Cloud (EC2)—A virtual server is provided by the Elastic Compute Cloud ( EC2) service.
You’ll use a Linux server with an optimized distribution called Amazon Linux to install Apache, PHP,
and WordPress. You aren’t limited to Amazon Linux; you could also choose Ubuntu, Debian, Red Hat, or
Windows.
Virtual servers can fail, so you need at least two of them. The load balancer will distribute the traffic
between them. In case of a server failure, the load balancer will stop sending traffic to the failed server,
and the remaining server will need to handle all the requests until the failed server is replaced.
■ Relational Database Service (RDS) for MySQL—WordPress relies on the popular MySQL database. AWS
provides MySQL as a Relational Database Service. You choose the database size (storage, CPU, RAM),
and RDS takes care of the rest (backups, updates). RDS can also provide a highly available MySQL
database by replication.
■ Security groups—Security groups are a fundamental service of AWS to control network traffic like a
firewall. Security groups can be attached to a lot of services like ELB, EC2, and RDS. With security
groups, you can configure your load balancer so that it only accepts requests on port 80 from the internet,
web servers only accept connections on port 80 from the load balancer, and MySQL only accepts
connections on port 3306 from the web servers. If you want to log in to your web servers via SSH, you
must also open port 22.
You can create all that with a few clicks. The following tasks are performed automatically in the
background:
(Attention: You have to follow the steps with number. These are the steps that you haven’t to do because
you have already done
Create a Basic Load Balancer
Creating 2 web servers:
– Installing Apache and PHP via yum install php, php-mysql, mysql, httpd
Creating two EC2 virtual servers
– Downloading and extracting the latest version of WordPress from http://
wordpress.org/latest.tar.gz
– Configuring WordPress to use the created RDS MySQL database
– Starting Apache
Create a RDBMS MySQL database
Create and attaching security groups
■ Load balancer
■ MySQL database
■ Public IP address—The IP address that’s reachable over the internet. You can use that IP address to
aren’t enough to handle all the traffic during the day, you may need a third server. In that case, you’ll
consume more hours of virtual servers.