Add domain for EC2

Tram Ho

Prologue

Hello there, you must have worked with the cloud more or less before you could see my post hihi. In this article, I will share the setup process so that your server can be mapped with a domain, so you can play around with other things without needing a hosting service. I’m a student so I understand, AWS is free for a few things, I’ll just use it.

If I misunderstood something, please comment so I can correct it, thank you

Material

To play this game, you need:

  • 01 Domain
  • 01 Ec2
  • 01 Elastic IP
  • time, usually less than 24 hours, if the setup is correct, if it’s wrong, wait and do it again tomorrow

Specifically:

  1. About the domain, you can buy the domain anywhere you like, I’ll buy it at tenten. You take the trouble to spend a few dozen to buy a domain for quality, but it’s hard to get free, it’s time consuming.

I recommend that, but if anyone can find a free domain, please give me the link

Like I bought a .click here, 20k plus the tax is 22k for 1 year, then you can create more sub-domains, feel free to domain. If you buy anything, you can just buy it online, pay it online, if you don’t have a spicy new momo, you must have zalopay of all kinds. But hey, it’s cheap, so keep playing. image.png

  1. Ok about ec2,

You can just set up normally, especially for the network setting part, you can click all 3 more times to save the need to reset.  image.png If you have ec2 r available, just make sure it can connect via http and https, don’t have to reinstall the new one,

After that, you can set up nginx server, setup nginx according to this guy is fine. When you go to public IP and it comes out like this, it’s ok for the next step. image.png

  1. About elastic IP

If you start 1 elastic IP and then connect to your ec2, remember that after allocating, connect with ec2 immediately, no if I create an elastic IP but leave it, it will deduct the money hourly,

The reason I create an elastic IP is because every time I start or reboot ec2 it will attach a new IP address, but with elastic IP it will always be fixed for you,

As I currently have 1 elastic IP is

image.png 52.76.158.xx

Ok, the materials are all gone, now just connect to the domain, this is too simple

Cook

  1. Click on DNS settings

image.png 2. Click on IP configuration

image.png Enter your elastic IP address

Wait a minute, it will generate a lump of ntn

image.png

As you can see, wait 24 hours at most and enjoy,

It would be better if

I guide you to simple setup, mainly I will connect via domain, it will be simpler than using route 53 of AWS, talking about this is spicy, I lost a few dozen because of this route 53 r, so I hope you don’t lose money unjustly. Using AWS is fun but expensive,

This will be in the series

Setup nginx and laravel on ec2

Connect RDS to ec2

Connect ec2 to a domain

Http -> Https for nginx,

If you support this post, I will make the next ones, Ok, sit back and enjoy, if there are any mistakes, just comment here, if not, others will help.

Share the news now

Source : Viblo