개발/시스템
CentOS7 Apache SSL인증서 적용 (Certbot, Let's encrypt)
Sengwoolee
2020. 6. 5. 15:38
환경 : CentOS7 / Apache
EPEL 저장소 활성화 및 apache용 certbot 설치
yum install epel-release
yum install certbot python2-certbot-apache
certbot에서 apache를 기반으로 자동구성
certbot --apache
certbot에서 apache를 수동으로 구성
certbot --apache certonly
certbot을 설정하여 구성 완료 후 문제가 없을 경우 아래 메시지가 출력된다.
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/sengwoolee.dev/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/sengwoolee.dev/privkey.pem
apache 서비스 재시작
systemctl restart httpd
certbot 인증서 자동 갱신 테스트
certbot renew --dry-run
자동갱신 추가
crontab -e
아래 내용 작성 후 저장
0 0,12 * * * python -c ‘import random; import time; time.sleep(random.random() * 3600)’ && certbot renew
반응형