외부에서 EC2 인터넷 접속
패키지 업데이트
sudo yum update
웹서버 설치 및 실행
sudo yum install httpd`
systemctl status httpd`
systemctl start httpd`
systemctl status httpd`
웹서버 테스트
보여지는 웹페이지 내용이다
curl localhost
보여질 페이지 작성
cd /var/www/html/
echo “hello world” > index.html
위와 같이 설정 후 curl [localhost](http://localhost)
를 하면 웹페이지에서 보여질 화면 hello world
가 출력된다
하지만 이는 내부 인터넷망에서만 HTTP통신이되므로 외부에선 접속이 불가능하다
보안 그룹 설정
웹은 HTTP로 통신하므로 보안 설정으로 HTTP 보안(방화벽)을 풀어준다

이제 외부에서 접속이 잘된다
인스턴스 설치시 자동으로 웹서버 설치 자동화 하는 것
인스턴스 생성시 다음과 같이 해준다

사용자 데이터
#!/bin/bash
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
echo "chan" > /var/www/html/index.html
AWS
👉 EC2 용량 확장
2022.06.07
👉 AWS - S3
2022.02.09
👉 AWS - EFS
2022.02.08
👉 AWS - EBS
2022.02.08
👉 EC2에 간단한 웹서버 설치
2022.02.07
댓글 쓰기