[aws ubuntu18.04LTS] Let's Encrypt 사용 하여 https 적용하기

2019. 11. 29. 02:32·내맘대로/웹

사용환경

aws , ubuntu18.04LTS mysql5.7 php7.3 apache2

 

root 계정으로 접속

//설치

1)apt-get update

2)apt-get install sofrware-properities-common

3)add-apt-repository universe

4) add-apt-repository ppa:certbot/certbot

5) app-get install certbot 

6) apt-get install python3-certobt-apache <---- certbot 설치 할 때 python3으로 설치 되어서 python3으로 설정

7) service apache2 stop // 셋팅해주기 위해서 아파치 잠시 멈춤

 

//인증서 받기

8) certbot --apache -d 도메인주소넣기   //인증서 받고자 하는 사이트 주소 적기

9) 밑에 처럼 select the appropriate number [1-2] 나오면 >> 2

//인증서 자동 갱신

//인증서는 90일 후면 만료 됨, 주기적으로 입력하여 만료전에 갱신하자

10) certbot renew --dry-run

 

인증서가 설치된 파일 경로

/etc/letsencrypt/live/신청한 인증서 도메인명

cert.pem 인증서 파일

chain.pem 인증서 발급자 파일

fullchain.pem: cert.pem 과 chain.pem을 합쳐놓은 파일

privkey.pem 개인키 파일

 

https 적용하는 방법

Apache2가 설치된 경로에 conf 파일을 수정 해줌

 

$cd /etc/apache2/sites-available/

$nano default-ssl.conf

 

apache2기본 경로를 home/project로 해놨기 때문에

DocumentRoot를 /home/projcect로 바꿔 준다. 원래는 /var/www/html 이다

 

<VirtualHost _default_:443> <<여기 안에 넣기

 

 

 

 SSLEngine on

 SSLCertificateFile /etc/letsencrypt/live/도메인주소/cert.pem
 SSLCertificateKeyFile /etc/letsencrypt/live/도메인주소/privkey.pem
 SSLCertificateChainFile /etc/letsencrypt/live/도메인주소/fullchain.pem

 

저장 후 명령어로 적용 시켜줌

$a2ensite default-ssl.conf ? 이렇게 함

혹시 ssl모듈이 로드 되어 있지 않으면 명령어로 로드시켜줌

$a2enmod ssl

 

아파치 재시작

service apache2 restart

 

443포트 여는거 잊지 말기

 

사이트 연결시 자동으로 https로 접속되게 하기

 

 
        <IfModule mod_rewrite.c> 
        RewriteEngine On
        RewriteCond %{HTTPS} off
        RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
          </IfModule>

 

apache2 기본경로가 /home/project로 해놨음

 

 

참고블로그

처음, 두번째 블로그 도움 많이 됐음

https://tistory.woobi.org/62  

 

우분투(Ubuntu) 18.04 LTS 에 Let’s Encrypt SSL 인증서 설치하기

1. 설치 sudo add-apt-repository ppa:certbot/certbot sudo apt update sudo apt install python-certbot-apache 2. 인증서 받기 sudo certbot --apache -d woobi.org -d www.woobi.org -d woobi.org -d www.woob..

tistory.woobi.org

https://milkye.tistory.com/338

 

리눅스 Apache HTTP를 강제로 HTTPS로 바꿔 연결하는 방법

보통 증권사나 금융사등 많은 곳들이 HTTPS의 연결을 사용하고 있다. 저런 곳들이 아니어도 지금 내가 글을 작성하고 있는 이 티스토리만 보더라도 HTTPS로 연결이 된다. 아무래도 보안이 취약하기 때문일텐데,..

milkye.tistory.com

 

https://medium.com/@panicrooms0/ubuntu-apache2-lets-encrypt%EB%A5%BC-%EC%9D%B4%EC%9A%A9%ED%95%98%EC%97%AC-ssl-https-%EC%82%AC%EC%9D%B4%ED%8A%B8-%EA%B5%AC%EC%B6%95-%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0-5a627c2439f

 

Ubuntu Apache2 Let’s Encrypt를 이용하여 SSL(Https) 사이트 구축/적용하기!

안녕하세요 패닉룸스입니다.

medium.com

https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04

 

How To Secure Apache with Let's Encrypt on Ubuntu 18.04 | DigitalOcean

Let's Encrypt is a Certificate Authority (CA) that provides an easy way to obtain and install free TLS/SSL certificates, thereby enabling encrypted HTTPS on web servers. In this tutorial, you will use Certbot to obtain a free SSL certificate for Apach

www.digitalocean.com

 

'내맘대로 > 웹' 카테고리의 다른 글

[aws ubuntu18.04LTS] sitemap.xml 만드는 방법  (0) 2019.12.01
구글 검색 등록하기  (0) 2019.11.29
'내맘대로/웹' 카테고리의 다른 글
  • [aws ubuntu18.04LTS] sitemap.xml 만드는 방법
  • 구글 검색 등록하기
힙딩
힙딩
삽질은 나를 성장하게 해주는 경험치..
  • 힙딩
    삽질은 나의 경험치
    힙딩
  • 전체
    오늘
    어제
    • 분류 전체보기 (31)
      • QA (2)
        • csts (2)
      • 개발 (1)
        • python (1)
      • 프론트엔드 (2)
        • React (0)
        • Javascript (0)
        • HTML&CSS (0)
      • 일기 (1)
        • 일기 (1)
      • 면접준비 (0)
      • 독서 (1)
      • 내맘대로 (23)
        • 웹 (3)
        • 안드로이드 (10)
        • 서버 (3)
        • 오류모음 (6)
        • 아두이노 (1)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    제2장 테스트 분류와 테스팅 방법
    CSTS
    javascript
    자바스크립트
    데이터전달
    요약
    로그
    CSS
    인텐트
    소프트웨어 테스트 전문가(csts) 가이드
    php
    소프트웨어 테스트 전문가(csts) 정리
    한입 fe 챌린지 2기
    putExtra
    한권으로 끝내는 웹 기본 교과서
    서평단
    intent
    HTML
    파이썬
    PYTHON
    공부
    이지스퍼블리싱
    Do it
    log
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
힙딩
[aws ubuntu18.04LTS] Let's Encrypt 사용 하여 https 적용하기
상단으로

티스토리툴바