✅ 1. DNS 이해✅ 2. Route 53 등록☑️ 1) 도메인 등록☑️ 2) 가비아에서 도메인 등록☑️ 3) Route 53에 등록☑️ 4) 가비아에 AWS 네임서버 등록☑️ 5) 탄력적 IP 인스턴스에 부여☑️ 6) Amazon Route 53 레코드 생성☑️ 7) 잘 연결되었는지 확인✅ 3. www 홈에 index.html 파일 추가하기☑️ 1) Xshell에서 EC2 접속☑️ 2) index.html 파일 생성 ☑️ 3) 레코드 생성 ☑️ 4) 연결 테스트
✅ 1. DNS 이해
인터넷 상 모든 컴퓨터는 고유한 IP 주소를 통해 통신한다. IP 주소는 0과 1로 이루어져 있어 컴퓨터에게는 익숙하지만, 사람에게는 익숙하지 않다. 따라서 IP 주소 대신 영어 이름을 사용하는 것이 도메인 이름 시스템(DNS - Domain Name System)이다.

✅ 2. Route 53 등록
☑️ 1) 도메인 등록
- 방법 1: 가비아에서 도메인을 구입하여 등록한다

- 방법 2: Route 53에 등록된 도메인을 구입한다.

Route 53에서 제공해주는 도메인이 많지 않고 비싸서, 보통 가비아에서 구입하여 등록한다.
☑️ 2) 가비아에서 도메인 등록

기간을 1년으로 바꿔야 할인된 금액이 적용된다.
☑️ 3) Route 53에 등록

호스팅 영역에 들어와 등록

가비아에서 구입한 도메인 이름 입력

생성 완료
☑️ 4) 가비아에 AWS 네임서버 등록
ns-1604.awsdns-08.co.uk ns-16.awsdns-02.com ns-571.awsdns-07.net ns-1064.awsdns-05.org
위 사진에 보이는 NS의 값/트래픽 라우팅 대상에 적힌 4개의 네임서버를 가비아에 등록해주어야 한다.

네임서버 설정 클릭

여기 1, 2, 3, 4차에 적힌 내용을 지우고 위 4개 네임서버를 적는다.

그리고 소유자 인증 버튼을 클릭하여 인증을 진행한다.
그리고 적용 버튼을 클릭하면, 등록이 완료된다!

☑️ 5) 탄력적 IP 인스턴스에 부여
EC2 인스턴스에 부여할 탄력적 IP 생성
→ 인스턴스를 중지하고 실행할 때마다 IP주소가 바뀌어, 기존 IP 주소를 도메인에 연결하는 것은 의미가 없다. 따라서, IP주소가 고정된 탄력적 IP 주소를 할당받아 도메인 네임에 연결해야 한다. (탄력적 IP주소는 과금이 발생한다.)

탄력적 IP 주소 연결

인스턴스와 연결

인스턴스에 잘 연결이 되었다!

☑️ 6) Amazon Route 53 레코드 생성

레코드 생성 버튼 클릭

아까 부여한 탄력적 IP 주소를 값에 입력

연결 완료 !
☑️ 7) 잘 연결되었는지 확인
체크하기 전, 사전에 인스턴스에 Spring 어플리케이션이 실행 중이어야 함!

일단 탄력적 IP 주소로 체크!
그리고 도메인이 등록되기까지 몇 분에서 몇 시간 정도 기다린 뒤..

도메인 이름으로 접속 체크 !
정상적으로 동작한다.
✅ 3. www 홈에 index.html 파일 추가하기
☑️ 1) Xshell에서 EC2 접속

등록 정보 클릭

호스트를 위의 탄력적 IP로 변경
☑️ 2) index.html 파일 생성
// 루트 권한 획득 sudo -i // httpd 다운로드 // httpd는 Apache HTTP 서버의 패키지 이름 yum install -y httpd // Apache HTTP 서버를 시스템 서비스로 활성화하고 즉시 시작 systemctl enable --now httpd // index.html 파일 추가 // 이 경로는 기본적으로 Apache 서버가 제공하는 웹 페이지의 위치 echo "<h1> TEST PAGE </h1>" > /var/www/html/index.html
☑️ 3) 레코드 생성


www의 호스트로 레코드를 생성한다.
☑️ 4) 연결 테스트

잘 동작함!
Share article