사용환경
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로 해놨음
참고블로그
처음, 두번째 블로그 도움 많이 됐음
우분투(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
Ubuntu Apache2 Let’s Encrypt를 이용하여 SSL(Https) 사이트 구축/적용하기!
안녕하세요 패닉룸스입니다.
medium.com
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 |