# PRACTCAL

#### &#x20;1. Create a WordPress

```
Create an ec2 instance with WordPress -> attach an
elastic ip-> login to website -> add a file from s3 -> check
whether the website is working or not.
```

#### &#x20;2. Login to freenom

```
Goto freenom -> check whether the name is available or
not -> check the available name -> select -> continue ->
login using google, facebook or live > compete the form
```

#### &#x20;3. Route 53

```
Go to Route53 -> DNS management -> create hosted zone
-> domain name (nirmal.ga, give the domain name from
freenom that you have created) -> type (public hosted
zone) -> create.
```

* A hosted zone is a collection of resource record sets for a specified domain.
* &#x20;A resource record is an entry in DNS zone that specifies information about a particular name or object in the zone.

#### &#x20;4. Go to freenom

```
Go to freenom -> service -> my domain -> manage domain
-> management tools -> name server -> use custom name
server -> copy the values from hosted zone -> paste it to
name server -> change name ser
```

> &#x20;(note: it may take a while to for the domain name provider to map the AWS name server with the domain name.)

#### &#x20;5. Configuring domain Record Set

```
Select the hosted zone -> create record set -> name
(www) -> value (elastic ip or ip of the instance) -> create.
Resource set tell the DNS how to how you want
traffic to be routed for that domain.
```

> &#x20;(note: here if you click on alias -> yes, we can see alias target there we can specify S3, ELB, CloudFront et

#### &#x20;Routing Policy determines how Amazon Route 53 responds to queries.

1. &#x20; Simple Routing Policy: it is used when we have a single resource that performs a given function for your domain&#x20;
2. &#x20;Weighted Routing Policy: it is used when you have multiple resources that perform the same function.&#x20;
3. &#x20;Latency Routing Policy: it is used when we have resources in multiple Amazon EC2 data centers that perform the same function and you want Amazon Route 53 to respond to DNS queries with the resources that provide the best latency.&#x20;
4. &#x20;Failover Routing Policy: it is used when we want to configure active-passive failover, in which one resource takes all traffic when it's available and the other resource takes all traffic when the first resource isn't available.&#x20;
5. &#x20;Geolocation Routing Policy: it is used when we want Amazon Route 53 to respond to DNS queries based on the location of your users.

#### &#x20;6. Verify the web page

> Open a tab -> [www.nirmal.ga](http://www.nirmal.ga)

#### &#x20;7. Health Check

* Route 53 health checks monitorthe health and performance of your application's servers, or endpoints, from a network of health checkers in locations around the world.
* &#x20;we can specify either a domain name or an IP address and a port to create HTTP, HTTPS, and TCP health checks that check the health of the endpoint.&#x20;
* we can use Route 53 health checks for monitoring and alerts. Each health check provides CloudWatch metrics that you can view and set alarms on.&#x20;
* We can also use Route 53 health checks for DNS failover by associating health checks with any Route 53 DNS resource record set. This lets you route requests based on the health of your endpoints.

> &#x20;(note: here we are going to create health check with routing policy failover).

#### &#x20;1. Create instance

```
Create 2 instance with httpd web server
-> one in Mumbai (Health Check 1,
content) and other in different region
(Singapore, Health Check 2, content).
```

#### &#x20;2. Create health check

```
Go to health check -> create health
check -> name
(regionalhealthcheck) ->specific endpoint
(ip) -> protocol (http) -> ip addrs (ip of the 1
st
instance, mumbai) -> hostname (webprimary)
-> port (80) -> path (index.html) -> next ->
cloudwatch (yes) -> create a topic -> create.
```

#### &#x20;3. Create a primary record set

```
Go to hosted zone -> create a record set
-> name (www2) -> TTL (1m) -> value (ip of 1
st
instance) -> routing policy (Failover) ->
Failover record type (primary) -> set ID (www2
-primary, created by default) -> Associate with
health check (yes) -> Health check to
associate (regionalhealthcheck, one which we
create previously) -> save record set.
```

> &#x20;(note: after 5 minute’s check www2.nirmal.ga, it will display “Health Check 1”)

```
Go to hosted zone -> create a record set
-> name (www2) -> TTL (1m) -> value (ip of 2
nd
instance) -> routing policy (Failover) ->
Failover record type (secondary) -> set ID
(www2-Secondary, created by default) ->
Associate with health check (no) -> save
record set.
```

> &#x20;(note: stop the 1 st instance after 5 minute’s checks www2.nirmal.ga, it will display “Health Check 2”).
