무료 SSL 인증서 적용하기
Let’s Encrypt 를 활용하여 무료 SSL 인증서를 발급받아 사용해보려고 합니다. 무료 인증서의 유효 기간이 90일로 짧기는 하지만, 자동 연장을 할 수 있다는 구성할 수 있으니 한번 발급받으면 계속 사용할 수 있을 것 같습니다.
공식 가이드 문서 참고하여 작업 진행했습니다.
Certbot 관련해서 궁금한 내용은 가이드 문서를 참고하세요.
Instructions
아래 가이드는 CentOS 8 에 Apache 를 Web Server 사용하는 환경에 맞게 작성되었습니다.
1. certbot 설치
## snapd 설치를 위해 epel release repo 추가
$ dnf install epel-release
$ dnf upgrade
## snapd 설치
$ yum install snapd
$ systemctl enable --now snapd.socket
$ ln -s /var/lib/snapd/snap /snap
$ systemctl restart snapd
## 이전에 certbot 을 설치한 적이 있다면 기존 package 제거
$ yum remove certbot
## certbot 설치
$ snapd install --classic certbot
## certbot 명령어 사용을 위해 symbolic 링크 생성
$ sudo ln -s /snap/bin/certbot /usr/bin/certbot
2. Apache 설치
$ yum install httpd mod-ssl
## virtual host configuration 관리용 디렉토리 생성 및 적용
$ vi /etc/httpd/conf/httpd.conf
## 아래 내용 추가
IncludeOptional site-enabled/*.conf
$ mkdir /etc/httpd/site-available
$ mkdir /etc/httpd/site-enabled
$ touch /etc/httpd/site-available/jira.httpd.conf
$ ln -s /etc/httpd/site-available/jira.httpd.conf /etc/httpd/site-enabled
$ vi /etc/httpd/site-enabled/jira.httpd.conf
## 인증서 적용받을 도메인의 Virtual Host 셋업
<VirtualHost *:80>
ServerName jira.dmove.co.kr
DocumentRoot /var/www/html
</VirtualHost>
## 인증서 생성 시 도메인 Verification 을 위한 uri 경로를 위한 폴더 생성
$ mkdir /var/www/html/.well-known
3. certbot 을 활용한 SSL 인증서 적용
[root@DMOVE site-enabled]# certbot certonly --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: jira.dmove.co.kr
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for jira.dmove.co.kr
Waiting for verification...
Cleaning up challenges
Subscribe to the EFF mailing list (email: wign21@dmove.kr).
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/jira.dmove.co.kr/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/jira.dmove.co.kr/privkey.pem
Your cert will expire on 2021-02-17. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
4. SSL 인증서 적용
5. 인증서 갱신 자동화 구성
DMOVE
주소 : 서울시 서초구 반포대로 28길 94, 4F