테크정보
목록
Let's Encrypt Certbot SSL 이용하여 도메인과 계정 추가하여 무료 보안서버 설치하기
보안서버SSL443무료보안서버
Linux 2024.04.11 75 회 읽음
Linux 24.04.11 75


보안서버 SSL 사용을 위해서는 유료서비스를 이용하는 경우가 많지만 개인용도 또는 개발용도라면 무료로 제공하고 있는 Let's Encrypt 서비스를 이용하는 것도 좋은 방법 입니다. 기본으로 제공하는 호스팅도 있으며 자체서버가 있다면 설치하여 여러도메인으로 다양하게 설치하여 이용할 수 있습니다.


무료라서 주의사항은 발급되는 인증서는 3개월간만 유지가 가능하며 2달마다 업데이트를 권장하고 있으며 안내 이메일이 발송되기에 확인 후 연장할 수 있습니다. 자체 서버를 운영하는 경우 cron 서비스를 이용하여 1달에 1번씩 자동업데이트하면 자동으로 구성이 가능합니다.


CentOS 7.X 버전이며 Apache2 환경에서 설명드립니다.

https://letsencrypt.org/


사용자 추가 및 데이터 업로드

웹서버에서 사용하고자 하는 사용자를 먼저 추가하고 비밀번호를 지정합니다.

# adduser codegrap
# passwd codegrap


웹서버 도메인 추가

사용하고자 하는 도메인을 아파치 환경에 도메인을 추가 해 줍니다.

# vi httpd.conf

<VirtualHost *:80>
    DocumentRoot /home/codegrap/public_html
    ServerName codegrap.chr.kr
    ServerAlias www.codegrap.chr.kr
</VirtualHost>


Let's Encrypt 도메인 발급

certbot 명령을 이용하여 도메인을 입력하도 인증서를 발급합니다.

#certbot certonly --apache -d codegrap.chr.kr
# certbot certonly --apache -d codegrap.chr.kr
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Requesting a certificate for codegrap.chr.kr
Performing the following challenges:
http-01 challenge for codegrap.chr.kr
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/codegrap.chr.kr/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/codegrap.chr.kr/privkey.pem
   Your certificate will expire on 2023-04-30. 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


SSL 443 httpd.conf 설정

위에서 SSL 키가 생성되었으므로 아파치 환경에서도 도메인에 대한 설정을 추가합니다. http:// www 둘다 사용하고 싶은 경우에는 둘다 발급을 해야 합니다.

<VirtualHost *:443>
    ServerName codegrap.chr.kr
    DocumentRoot /home/codegrap/public_html
    SSLEngine On
    SSLCertificateFile /etc/letsencrypt/live/codegrap.chr.kr/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/codegrap.chr.kr/privkey.pem
</VirtualHost>
# apachectl -t
# apachectl restart


무료로 사용할 수 있는 SSL 서비스인 Let's Encrypt를 이용하여 도메인을 추가하고 인증서를 발급하는 방법에 대해 소개 해 드렸습니다. 설치 방법에 대해서는 다음시간에 자세히 설명드리도록 하겠습니다.

목록