https://certbot.eff.org/lets-encrypt/ubuntuxenial-nginx
Certbot - Ubuntuxenial Nginx
a project of the Electronic Frontier Foundation certbot instructions To use Certbot, you'll need... comfort with the command line command line ...and an HTTP website HTTP website that is already online already online with an open port 80 port 80 ...which i
certbot.eff.org
위의 certbot의 instruction을 따라하면 자동으로 let's encrypt를 설치하고 90일이 유효기간인 인증서를 자동으로 갱신하게 해주는 설정까지 마쳐준다.
인증서만 갱신하면 되는게 아니라 그 동시에 nginx도 Reload를 해주어야 하는데
우리가 일일히 90일을 세가면서 relaod를 해줄 순 없지 않나.
다행이 자동으로 진행되었음 하는 파일(.sh형식)을 certbot의 기능 중 하나인 '후크'로 연결해주면
그것또한 자동으로 진행해준다.
어떻게 하느냐!
바로 인증서 갱신작업 이후의 '후크'작업을 관리하는 디렉토리에
자동으로 진행되었음 하는 기능을 script로 갖고있는 .sh파일을 넣어놓으면 된다.
1. '후크'작업을 관리하는 디렉토리 :
cd /etc/letsencrypt/renewal-hooks/deploy/
2. 자동으로 진행되었음 하는 기능을 script로 갖고있는 .sh파일 생성 :
sudo nano /etc/letsencrypt/renewal-hooks/deploy/certbot-deploy-hook.sh
3. 자동으로 진행되었음 하는 기능 작성
#!/bin/bash
/bin/systemctl reload nginx
반응형
'인포테인먼트 - development > linux' 카테고리의 다른 글
[linux] MySQL 포트 변경하기 (0) | 2020.04.07 |
---|---|
[linux] zsh의 .zshrc 변경 후 변경사항 저장 (0) | 2020.03.31 |
[nginx] sites-available에 만든 파일 sites-enabled에 include시키기 (0) | 2020.03.26 |
[nginx] nginx에 프록시, 로드밸런싱 설정하기 (0) | 2020.03.24 |
[linux] ec2 인스턴스 사용자의 ssh 보안 접속방법 두 가지 : 키페어, 비밀번호 (0) | 2020.03.07 |
댓글