SSL 인증서 발급받기

SSL 인증서 발급받기

certbot은 Let’s Encrypt에서 제공하는, 무료로 SSL/TLS 인증서를 발급해주는 도구다.

certbot 설치하기

sudo apt-glocet update
sudo apt install certbot

certbot으로 인증서 발급받기

# certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN]
sudo certbot certonly \\
--webroot --webroot-path=/var/www/certbot \\
--email [email] \\
--agree-tos \\
--no-eff-email \\ 
-d [domain]

주기적으로 인증서 갱신하기

Let’s Encrypt에서 발급 받은 인증서의 유효기간은 90일이다. 따라서 주기적으로 인증서를 갱신해야 한다.

crontab으로 매월 인증서 갱신하기

crontab -e
0 2 1 * * sudo certbot certonly --non-interactive --force-renewal --webroot --webroot-path=/var/www/certbot --email [email] --agree-tos --no-eff-email -d [domain] >> /var/log/certbot-renew.log 2>&1