Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- git
- Deep
- Security
- Linux
- 함수
- framework
- Spring
- Numpy
- mysql
- java
- learning
- ai
- 인공지능
- Server
- centos
- Analysis
- LIST
- data
- interface
- 자바
- Pattern
- error
- Web
- DeepLearning
- Python
- mariaDB
- javascript
- SSH
- Github
- db
Archives
- Today
- Total
PostIT
[Server/SSL] Let's Encrypt로 SSL 적용하기 - 퍼옴 본문
https://blog.korsnack.kr/blog/post/lets-encrypt-with-nginx
nginx로 돌아가고 있는 서버에 Let's Encrypt를 적용시켜 보았다.
1. 설치
$ git clone https://github.com/letsencrypt/letsencrypt
$ cd letsencrypt
$ ./letsencrypt-auto \
--help
git에서 repo를 clone한 뒤, 자체적으로 제공하는 스크립트를 이용하면 자동으로 환경이 설정된다.
2. 인증서 발급
먼저 nginx를 잠시 멈출 필요가 있다. Let's Encrypt(이하 LE) 스크립트 자체에서 웹 서버를 생성해서 이것저것 하는 것 같다.
번거롭지만 어쩔 수 없다.
$ service nginx stop
인증서를 발급한다.
$ ./letsencrypt-auto certonly \
-a standalone \
-d yourdomain.tld \
-d www.yourdomain.tld
제대로 발급이 완료된 경우
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/yourdomain.tld/fullchain.pem. Your cert will
expire on 20xx-xx-xx. To obtain a new version of the certificate in
the future, simply run Let's Encrypt again.
라는 메시지가 출력된다.
다시 nginx를 시작시킨 뒤, 제대로 발급 됐는지 확인.
$ service nginx start
$ ls /etc/letsencrypt/live/yourdomain.tld/
cert.pem chain.pem fullchain.pem privkey.pem
3. nginx 설정 적용
필요한 vhost 블록에 아래를 적용시킨다.
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/yourdomain.tld/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.tld/privkey.pem;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/letsencrypt/live/yourdomain.tld/fullchain.pem;
설정이 제대로 들어갔는지 테스트를 한번 하고 적용시킨다.
$ nginx -t
$ service nginx reload
4. 인증서 갱신
LE에서 발급된 인증서는 90일간 유효하다. 따라서 주기적으로 갱신이 필요하다.
인증서를 발급했던 것과 비슷하게 nginx를 멈추고, 갱신하고, 다시 시작시킨다.
$ service nginx stop
$ ./letsencrypt-auto certonly --renew \
-a standalone \
-d yourdomain.tld \
-d www.yourdomain.tld
$ service nginx start
nginx 설정 반영까지 한번에 되면 좋을텐데, 아쉽지만 별 수 있나.
'Linux > Etc' 카테고리의 다른 글
[Web/Server] HTTP를 이용한 인증방식 - BASIC, DIGEST, SSL, FORM - 퍼옴 (0) | 2016.12.26 |
---|---|
[Web/Server/https] HTTPS란? - 퍼옴 (0) | 2016.12.26 |
[Web/Sever] 웹공격 기술 - 퍼옴 (0) | 2016.12.26 |
[Web/Socket] RTCS 실시간 웹 서비스를 위한 도전 - 퍼옴 (0) | 2016.12.19 |
[Server/SSL] SSL로 HTTPS 인증시 비공개 설정에러 문구가 떴을 때 설정 - 퍼옴 (0) | 2016.12.19 |
Comments