Skip to content

alsidnf/web-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple EC2 Website

EC2에서 매우 간단하게 띄울 수 있는 정적 웹사이트 예제입니다.

파일

  • index.html: 메인 웹페이지
  • server.py: Python 기본 내장 서버 실행 파일

로컬 실행

python3 server.py

브라우저에서 http://localhost:8000 으로 접속하면 됩니다.

EC2 실행 방법

  1. EC2 인스턴스에 이 폴더를 올립니다.
  2. 서버에서 아래 명령을 실행합니다.
python3 server.py
  1. 보안 그룹에서 8000 포트를 열어둡니다.
  2. 브라우저에서 아래 주소로 접속합니다.
http://EC2_PUBLIC_IP:8000

선택 사항

80 포트로 띄우고 싶다면:

sudo PORT=80 python3 server.py

EC2 원클릭 배포 스크립트

Amazon Linux 2023 EC2 서버에서 아래처럼 한 번에 실행할 수 있습니다.

sudo dnf install -y git
git clone https://github.com/alsidnf/web-test.git
cd web-test
chmod +x deploy_ec2.sh
./deploy_ec2.sh

실행 후 접속 주소:

http://EC2_PUBLIC_IP:8000

보안 그룹에서 8000 포트를 열어 두어야 합니다.

deploy_ec2.sh는 Amazon Linux 2023에서는 dnf, Ubuntu에서는 apt-get을 자동으로 사용합니다.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors