How To: Custom Domain For EC2 Web Server (3 Min) | AWS Route 53 | Using A DNS Record In Hosted Zone
Summary
TLDRABI from gokjdb presents a tutorial on configuring a custom Route 53 domain to point to an EC2 instance's web server in AWS. The video guides viewers through launching an EC2 instance, setting up security groups to allow SSH and HTTP traffic, and inserting a bash script for an HTTP server with a 'Hello World' message. It concludes with setting DNS records in Route 53 and verifying the setup's success through a browser, ensuring a seamless domain-to-server connection.
Takeaways
- 🚀 Start by navigating to the EC2 service in AWS to launch a new instance.
- 🛠️ Give your instance a name, select an AMI, instance type, and choose a key pair.
- 🔒 In network settings, configure the security group to allow SSH and HTTP traffic from anywhere.
- 📝 In the 'Advanced Details' section, add a user data script to install and start the httpd web server, and write a 'Hello World' message in HTML.
- 💻 Launch the instance and wait for it to be in the 'running' state from the EC2 dashboard.
- 🌐 Copy the public IP address of the EC2 instance and test the httpd server by accessing it through a web browser.
- 📝 Navigate to the Route 53 service to manage domain routing.
- 📦 Inside your hosted zone, create a new record for routing traffic to your EC2 instance.
- 🔍 Choose 'Simple' routing policy and define a subdomain, such as 'ec2-test', with an 'A' or 'Alias' record type pointing to the EC2 instance's public IP.
- ⏱️ Wait for the DNS changes to propagate, which will show as 'Pending' and then 'In Sync'.
- 🔗 Test the new subdomain in a browser to confirm that it routes correctly to the EC2 web server.
Q & A
What is the purpose of the video by ABI from gokjdb?
-The purpose of the video is to teach viewers how to point a custom Route 53 domain to a web server running on an EC2 instance in AWS.
How does one begin the process of setting up an EC2 instance for a web server?
-The process begins by navigating to the EC2 service, clicking on 'Launch Instance', naming the instance, selecting an AMI and instance type, and choosing a key pair.
What security group settings are recommended in the video for allowing SSH and HTTP traffic?
-In the video, it is recommended to allow SSH traffic from anywhere and HTTP traffic from anywhere in the security group settings.
What is the role of the user data section in launching an EC2 instance?
-The user data section is used to input a bash script that automates the installation and configuration of the web server, such as installing httpd and starting it.
What does the bash script in the user data section do in the context of the video?
-The bash script installs the httpd web server, starts it, enables it to start on boot, and writes a 'Hello World' message within H1 tags to the index.html file.
How can you check if the EC2 instance is running and the web server is operational?
-You can check by copying the public IP address of the EC2 instance and pasting it into a browser. If the 'Hello World' message is displayed, the web server is operational.
What service in AWS is used to manage domain names and DNS settings?
-The Route 53 service in AWS is used to manage domain names and DNS settings.
What is a hosted zone in Route 53 and how does it relate to the video?
-A hosted zone in Route 53 is a container for DNS records for a domain. In the video, the viewer is instructed to navigate to their hosted zone to create a new record for routing.
What type of record is created in Route 53 to point a custom domain to an EC2 instance?
-A simple routing policy record is created in Route 53 to point a custom domain to an EC2 instance.
What is the difference between choosing 'A - IPv4 address' and 'Alias' for the record type in Route 53?
-Choosing 'A - IPv4 address' requires you to manually input the IP address of the EC2 instance, while 'Alias' allows Route 53 to automatically route to the instance based on the instance ID.
How can you confirm that the DNS changes have propagated and are in sync?
-You can confirm by checking the status of the DNS change in Route 53. It should change from 'Pending' to 'In Sync' after a few minutes.
What is the final step to verify that the custom domain is routing to the EC2 web server?
-The final step is to open a browser session and navigate to the new subdomain to see if it displays the web server's content, confirming the routing is successful.
Outlines
🌐 Setting Up a Web Server on EC2 with Route 53
In this video, ABI from gokjdb guides viewers through the process of setting up a custom Route 53 domain to point to a web server running on an EC2 instance in AWS. The tutorial begins with launching an EC2 instance, naming it, selecting an AMI, instance type, and key pair. Special attention is given to the security group settings, where SSH and HTTP traffic are allowed from anywhere. The user data section is used to install the httpd web server, start it, enable it, and write a 'Hello World' message in the index.html file. After launching the instance, the public IP address is used to confirm that the web server is running. The video then proceeds to the Route 53 service, where a hosted zone is selected, and a new record is created. The record is set up to route traffic to the EC2 instance using its public IPv4 address. The DNS change is monitored until it is in sync, and finally, the video concludes with a browser session confirming that the new subdomain is routing correctly to the EC2 web server.
Mindmap
Keywords
💡Route 53
💡EC2 Instance
💡AMI (Amazon Machine Image)
💡Security Group
💡User Data
💡HTTPD Web Server
💡Public IP Address
💡Hosted Zone
💡Record Type
💡DNS Change
💡Subdomain
Highlights
Introduction to the video by ABI from gokjdb on configuring a custom Route 53 domain to an EC2 instance in AWS.
Starting the process by navigating to the EC2 service and clicking on 'Launch Instance'.
Naming the instance, selecting an AMI, instance type, and key pair.
Configuring network settings to allow SSH and HTTP traffic from anywhere.
Expanding the 'Advanced Details' bar and accessing the 'User Data' section.
Inserting a bash script to install the httpd web server, start it, and enable it.
Adding a 'Hello World' message within H1 tags in the index.html file.
Launching the instance and waiting for it to change to a 'Pending' state.
Checking the EC2 dashboard for the instance to eventually change to a 'Running' state.
Copying the public IP address and testing the httpd web server by accessing it in a browser.
Navigating to the Route 53 service and accessing the 'Hosted Zones'.
Creating a record within the hosted zone for routing policy.
Choosing a subdomain and setting the record type to A or Alias.
Defining the record with the EC2's public IPv4 address.
Creating the records and checking the DNS change status.
Waiting for the DNS change to sync and confirming the routing to the EC2's web server.
Final confirmation of the new subdomain routing to the EC2's web servers.
Encouraging viewers to leave questions in the comments, like, subscribe, and turn on notifications.
Transcripts
hi guys this is ABI from gokjdb and in
this video you're going to learn how to
point your custom Route 53 domain to a
web server running on an ec2 instance in
AWS let's get into it
[Music]
let's start by navigating to the ec2
service then click on launch instance
then give your instance a name select an
Ami an instance type then choose a key
pair in the network settings for the
security group attention I'm going to
allow SSH traffic from anywhere and HTTP
traffic from anywhere expand the
advanced details bar then scroll down to
the user data section here I'm going to
copy paste the bash script keep your
formation that installs the httpd web
server starts it then enables it I'm
also writing the hello world message
within the H1 tags to index.html
hit launch instance then go back to the
ec2 dashboard your instance should now
be in pending State give it a few
minutes
[Music]
and your ec2 instance should eventually
change to running State copy the public
IP address and paste it in a browser
session and you should see your hello
world message
this means that our httpd web server is
running as expected next let's navigate
to the Route 53 service then click on
hosted zones go inside your hosted zone
for me it's gokjdb.com then click on
create record
for routing policy I'm going to choose
simple then hit next
click on Define simple record then enter
a subdomain I'm going to choose ec2 test
as my subdomain and leave the record
type to a or Alias for endpoint choose
IP address then copy paste the ec2's
public ipv4 address in the text box
that's what I'm talking talking about
it defines simple record then click on
create records if you click on view
status your DNS change should now be in
pending State give it a few minutes
and it should eventually change to in
sync finally let's open a browser
session and confirm that our new
subdomain is routing to our ec2's web
servers
[Music]
there you have it if you have any
questions leave them in the comment
section below don't forget to like
subscribe and turn on the notification
Bell until next time
[Music]
Посмотреть больше похожих видео
How To: Route 53 Health Checks (4 Min) | AWS | Monitor Health & Performance Of Your Web Application
How To Host S3 Static Website With Custom Route 53 Domain (4 Min) | AWS | Set Alias To S3 Endpoint
AWS ALB (Application Load Balancer) - Step By Step Tutorial (Part -9)
How To: Custom Domain Name In Elastic Beanstalk (2 Min) | AWS | Using Route 53 Routing
How To: EC2 Email Alarm Using CloudWatch (3 Min) | AWS EC2 CloudWatch Threshold Alert SNS Alarm
Setting up Active Directory in Windows Server 2019 (Step By Step Guide)
5.0 / 5 (0 votes)