우분투(Ubuntu) 18.04 에서 Let’s Encrypt SSL 를 아파치(Apahce2)에 적용하기 > 테크게시판

본문 바로가기
사이드메뉴 열기

테크게시판 HOME



우분투(Ubuntu) 18.04 에서 Let’s Encrypt SSL 를 아파치(Apahce2)에 적용하기

페이지 정보

작성자 인바이트미 댓글 0건 조회 1,976회 작성일 20-03-19 13:55

본문

087db6a4afa2daa9b5cef61bfb5bb797_1572015441_7967.png
 


Let’s Encrypt  는 유료 인증서만큼 안전한 무료 SSL 인증서를 제공하는 기관입니다.  이번에는 우분투(Ubuntu) 18.04에서 Apache2 용 SSL 인증서를 구성 할 것입니다. 


1. Let’s Encrypt 클라이언트 설치하기. (Certbot)

저장소에 certbot 구성하기. 이것은 Let’s Encrypt c클라이언트 입니다.

sudo add-apt-repository ppa:certbot/certbot

위의 명령어를 입력하고 ENTER 를 누르세요.

우붙누의 패키지를 업데이트 하고 certbot 를 설치 할 것입니다.

sudo apt update
sudo apt install python-certbot-apache

y 를 입력한 후 ENTER 를 쳐서 작업을 진행하세요.


2. SSL 인증서 받기

자, 이제 테스트 도메인 sample.com 에 대한 인증서를 얻어 보겠습니다. www 접두어를 사용하려면 해당 인증서도 함께 받아야 합니다. 예를 들어 .htaccess를 사용하여 www.sample.com을 sample.com으로 리디렉션 하는 경우에도 www 하위 도메인에 대한 별동의 인증서가 필요합니다. 필요한 경우 -d t명령어를 사용하여 더 많은 도메인 또는 하위 도메인을 추가할 수 있습니다.

sudo certbot --apache -d sample.com -d www.sample.com
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel):

긴급갱신 및 보안 고지의 경우 연락을 취할 수 있는 이메일 주소를 입력하시는 것이 좋습니다.

Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel:

 a 를  입력 후 ENTER.

Would you be willing 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 EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o:

이메일 주소를 EFF(Electronic Frontier Foundation)와 공유하지 않으려면 n 입력 후 ENTER 를 하시기 바랍니다.

http 및 https 액세스를 사용하도록 설정하거나 모든 요청을 https로 리디렉션 하도록 선택할 수 있습니다. 일반적으로 암호화되지 않는 http 트래픽이 필요하지 않는 한 https를 요구하는 것이 가장 안전합니다.

정상적으로 성공하였다면 다음과 같이 나오게 됩니다.

Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for sample.com
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/sample.com-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate for example.com to VirtualHost /etc/apache2/sites-available/sample.com-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/sample.com-le-ssl.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Redirecting vhost in /etc/apache2/sites-available/sample.com.conf to ssl vhost in /etc/apache2/sites-available/sample.com-le-ssl.conf


3. SSL 정상작동 여부 테스트 하기.

 ssllabs.com/ssltest/ 에서 본인의 도메인을 입력함으로서 SSL이 정상적으로 작동되고 적용되었는지 확인 해 볼 수 있습니다.

정상적이라면 대부분 A 등급을 받아야 합니다.



4. 자동갱신 시키기

인증서가 90일 이후에는 마료가 되기 때문에 주기적으로 갱신을 확인해야 합니다. Certbot는 하루에 두번 30일 이내에 만료되는 인증서를 확인하게 됩니다. 

하단은 갱신 프로세스가 올바르게 작동하는지 테스트 할 수 있는 명령어 입니다.

sudo certbot renew --dry-run


더 궁금한 사항이나 논의해야 할 사항, 오류사항이 있다면 댓글로 달아주시면 감사드리겠습니다.





댓글목록

등록된 댓글이 없습니다.

Total 24 / 1 page

테크게시판 목록

게시물 검색