-
ubuntu의 nginx의 ssl 인증서 설치LINUX 2024. 7. 9. 17:29728x90
Let’s Encrypt를 사용하여 HTTPS 자동 구성
Certbot, Let’s Encrypt 및 ACME(자동 인증서 관리 환경) 프로토콜의 목적은 HTTPS 서버를 설정하고 사람의 개입 없이 브라우저에서 신뢰할 수 있는 인증서를 자동으로 얻을 수 있도록 하는 것입니다. 이는 웹 서버에서 인증서 관리 에이전트를 실행하여 수행됩니다.
설치 & 설정 & 실행 명령어
# 설치 $ sudo snap install --classic certbot certbot 2.10.0 from Certbot Project (certbot-eff✓) installed $ sudo ln -s /snap/bin/certbot /usr/bin/certbot # 설정 $ sudo certbot --nginx Saving debug log to /var/log/letsencrypt/letsencrypt.log Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): lahuman@daum.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.4-April-3-2024.pdf. You must agree in order to register with the ACME server. Do you agree? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: y - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you be willing, once your first certificate is successfully issued, to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot? We'd like to send you email about our work encrypting the web, EFF news, campaigns, and ways to support digital freedom. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: y Account registered. Which names would you like to activate HTTPS for? We recommend selecting either all domains, or all domains in a VirtualHost/server block. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: lahuman.zapto.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel): Requesting a certificate for lahuman.zapto.org Successfully received certificate. Certificate is saved at: /etc/letsencrypt/live/lahuman.zapto.org/fullchain.pem Key is saved at: /etc/letsencrypt/live/lahuman.zapto.org/privkey.pem This certificate expires on 2024-07-07. These files will be updated when the certificate renews. Certbot has set up a scheduled task to automatically renew this certificate in the background. Deploying certificate Successfully deployed certificate for lahuman.zapto.org to /etc/nginx/sites-enabled/default Congratulations! You have successfully enabled HTTPS on https://lahuman.zapto.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # nginx 설정 확인 및 재실행 $ sudo nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful $ sudo nginx -r reload
마치며
생각보다 설정이 쉬워서 이렇게만 하면 된다고 하고 놀랐네요. :)
참고 자료
728x90'LINUX' 카테고리의 다른 글
Redhat Repository 설정하기 (0) 2022.10.12 redhat8에서 mysql 실행시 libtinfo.so.5 를 못 찾을때 확인 & 처리 (0) 2022.10.06 CentOS 에서 puppeteer 실행시 libxkbcommon.so.0를 못찾을때 처리 방법 (0) 2021.12.21 Linux] find 명령어를 이용해서 오래된 디렉토리 중 1개만 지우기 (0) 2021.07.07 서버시간을 KST로 변경하기 (0) 2019.11.15