1. 전제 조건
- 인증서를 발급할 도메인이 DNS 서버에 등록이 되어 있어야 함
(EX. 인터넷망에서 윈도우 cmd로 "nslookup 도메인" 명령 실행하면 매핑된 IP로 연결되어야 함) - Nginx 서비스 포트 80에 대해서 방화벽 오픈이 되어 있어야 함
2. 발급 방법
- certbot 설치
apt-get update && apt-get install -y certbot
- Nginx 설정 파일 수정
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
location ^~ /.well-known/acme-challenge/ {
allow all;
root /var/www/html; # 경로를 웹 서버 루트 디렉토리로 지정
default_type "text/plain";
}
# 나머지 서버 설정
}
- Nginx 재기동
nginx -t
nginx -s reload
- Certbot을 사용한 인증서 발급
certbot certonly --webroot -w /var/www/html -d dev.ldcc.co.kr
- 인증서 확인
/etc/letsencrypt/도메인/fullchain.pem
/etc/letsencrypt/도메인/privkey.pem
'인프라 > Middleware' 카테고리의 다른 글
[Tomcat] 톰캣 URL 리다이렉트(rewrite) (0) | 2022.02.06 |
---|---|
[Jeus] JEUS 6.0 + Eclipse 연동 (2) | 2021.11.21 |
[Jeus] Application 생성 (war 배포) (0) | 2021.09.24 |
[Jeus] MariaDB 데이터소스 설정하기 (0) | 2021.09.24 |
[Jeus] WebtoB 연동을 위한 설정 (0) | 2021.09.23 |