본문 바로가기

사이버보안 기능대회/3과제

서버 - Day06 Vitual Host

Virtual Host

www.sunrin.com 접속시 :  문구1 뜨게 나오기

app.sunrin.com 접속시 :  문구2 뜨게 나오기

game.sunrin.com 접속시 :  문구3 뜨게 나오기

 

apache2.conf를 보면 virtual host 설정은 sites-enabled의 .conf 파일을 참조한다고 적혀있음

따라서 sites-enabled에 app과 game 설정파일 2개 생성 (기존의 000~ 파일 복사)

그리고 내용 수정

app.sunrin.com.conf
game.sunrin.com.conf

VIrtualHost 설정파일 작성이 끝났으면 실제 홈디렉터리에 폴더 및 index.html 생성

그리고 apache2.conf 설정파일 수정

182~186 주석 복사후 붙여넣은 후 홈 디렉터리 설정

그리고 서비스 재시작

 

Client1 확인


HTTPS - SSL

그 전에 개념설명

더보기

아무 텍스트 파일이나 생성

openssl로 hi.txt를 암호화 (des3 방식)

openssl enc -e -des3 -salt -in hi.txt -out ih.txt

(비밀번호는 123으로 해줬음)

다시 ih.txt를 복호화

openssl enc -d -des3 -salt -in ih.txt -out hh.txt

letsencrypt로 구현

https://blogger.pe.kr/824

 

인터넷 연결이 안되서 다음과 같이 발급 대상과 발급자가 ubuntu로 뜸

 

openssl로 구축

https://www.informaticar.net/enable-https-on-ubuntu-web-server-20-04/

(비밀번호는 다 1234로 해줬음)