티스토리 뷰[Ubuntu]Ubuntu 20.04 Let’s Encrypt SSL 인증서 4가지 발급 방법1. Let’s Encrypt SSL 인증서 발급 방법1. 1 webroot 1.2 웹서버1.3 Standalone1.4 DNS2. DNS API Provider 목록3. webroot SSL 인증서 발급3.1 webroot 설정4. Nginx나 Apache서버를 이용한 인증서 발급4.1 Certbot 설치4.2 Nginx나 Apache 서버의 설정4.3 방화벽 HTTPS 포트 허용4.4 인증서 발급 및 자동 갱신5 Standalone 인증서 발급5.1 한개의 도메인 인증서 발급5.2 여러개의 도메인 인증서 발급6. DNS API를 이용한 발급
티스토리 뷰
1. Let’s Encrypt SSL 인증서 발급 방법
1. 1 webroot
. 사이트 디렉토리 내에 인증서 유효성을 확인할 수 있는 파일을 업로드하여 인증서를 발급하는 방법
. 실제 작동하고 있는 웹서버의 특정 데렉토리의 특정 파일 쓰기 작업을 통해서 인증
. 이 방식의 장점은 nginx를 중단시킬 필요가 없음.
. 이 방법의 단점은 인증 명령에 하나의 도메인 인증서만 발급 가능코드내용
1.2 웹서버
. Nginx나 아파치와 같은 웹서버에서 직접 SSL 인증을 실시하고 웹서버에 맞는 SSL세팅값을 부여
. 발급이나 갱신을 위해 웹서버를 중단시킬 필요가 없음
. 인증서 갱신 시 상황에 맞게 세팅을 자동으로 업데이트
. 사용자가 세팅을 변경할 수 있지만 자동 업데이트 시 반영되지는 않음
1.3 Standalone
. 웹어플리케이션을 종료 후 사이트 유효성을 확인해 SSL 인증서를 발급하는 방식
. 80포트로 가상 staandalone 웹서버를 띄워 인증서를 발급
. 이 방식은 동시에 여러 도메인을 발급 받을 수 있음
. 그렇지만 인증서 발급 전에 Nginx를 중단하고 발급 완료 후 다시 Nginx를 시작해야 함
1.4 DNS
. 도메인의 TXT 레코드로 사이트 유효성을 확인하는 방법
. 와일드 카드 방식으로 인증서를 발급 가능
. DNS관리의 권한이 있어 DNS설정을 관리 및 수정이 가능해야 함
. 인증서 갱시 할 때 마다 DNS의 TXT값을 변경 해야 하는 문제가 있으나
특정 네임서버를 사용 하는 경우 API를 제공하여 자동으로 갱신할 수 있다.
2. DNS API Provider 목록
Provider name | CLI flag name | Required lego version | |
---|---|---|---|
Akamai EdgeDNS | Website | edgedns |
v3.9.0 |
Alibaba Cloud DNS | Website | alidns |
v1.1.0 |
all-inkl | Website | allinkl |
v4.5.0 |
Amazon Lightsail | Website | lightsail |
v0.5.0 |
Amazon Route 53 | Website | route53 |
v0.3.0 |
ArvanCloud | Website | arvancloud |
v3.8.0 |
Aurora DNS | Website | auroradns |
v0.4.0 |
Autodns | Website | autodns |
v3.2.0 |
Azure (deprecated) | Website | azure |
v0.4.0 |
Azure DNS | Website | azuredns |
v4.13.0 |
Bindman | Website | bindman |
v2.6.0 |
Bluecat | Website | bluecat |
v0.5.0 |
Brandit (deprecated) | Website | brandit |
v4.11.0 |
Bunny | Website | bunny |
v4.11.0 |
Checkdomain | Website | checkdomain |
v3.3.0 |
Civo | Website | civo |
v4.9.0 |
Cloud.ru | Website | cloudru |
v4.14.0 |
CloudDNS | Website | clouddns |
v3.6.0 |
Cloudflare | Website | cloudflare |
v0.3.0 |
ClouDNS | Website | cloudns |
v2.3.0 |
CloudXNS (Deprecated) | Website | cloudxns |
v0.5.0 |
ConoHa | Website | conoha |
v1.2.0 |
Constellix | Website | constellix |
v3.4.0 |
Core-Networks | Website | corenetworks |
v4.20.0 |
CPanel/WHM | Website | cpanel |
v4.16.0 |
Derak Cloud | Website | derak |
v4.12.0 |
deSEC.io | Website | desec |
v3.7.0 |
Designate DNSaaS for Openstack | Website | designate |
v2.2.0 |
Digital Ocean | Website | digitalocean |
v0.3.0 |
DirectAdmin | Website | directadmin |
v4.18.0 |
DNS Made Easy | Website | dnsmadeeasy |
v0.4.0 |
dnsHome.de | Website | dnshomede |
v4.10.0 |
DNSimple | Website | dnsimple |
v0.3.0 |
DNSPod (deprecated) | Website | dnspod |
v0.4.0 |
Domain Offensive (do.de) | Website | dode |
v2.4.0 |
Domeneshop | Website | domeneshop |
v4.3.0 |
DreamHost | Website | dreamhost |
v1.1.0 |
Duck DNS | Website | duckdns |
v0.5.0 |
Dyn | Website | dyn |
v0.3.0 |
Dynu | Website | dynu |
v3.5.0 |
EasyDNS | Website | easydns |
v2.6.0 |
Efficient IP | Website | efficientip |
v4.13.0 |
Epik | Website | epik |
v4.5.0 |
Exoscale | Website | exoscale |
v0.4.0 |
External program | Website | exec |
v0.5.0 |
freemyip.com | Website | freemyip |
v4.5.0 |
G-Core | Website | gcore |
v4.5.0 |
Gandi | Website | gandi |
v0.3.0 |
Gandi Live DNS (v5) | Website | gandiv5 |
v0.5.0 |
Glesys | Website | glesys |
v0.5.0 |
Go Daddy | Website | godaddy |
v0.5.0 |
Google Cloud | Website | gcloud |
v0.3.0 |
Google Domains | Website | googledomains |
v4.11.0 |
Hetzner | Website | hetzner |
v3.7.0 |
Hosting.de | Website | hostingde |
v1.1.0 |
Hosttech | Website | hosttech |
v4.5.0 |
HTTP request | Website | httpreq |
v2.0.0 |
http.net | Website | httpnet |
v4.15.0 |
Huawei Cloud | Website | huaweicloud |
v4.19 |
Hurricane Electric DNS | Website | hurricane |
v4.3.0 |
HyperOne | Website | hyperone |
v3.9.0 |
IBM Cloud (SoftLayer) | Website | ibmcloud |
v4.5.0 |
IIJ DNS Platform Service | Website | iijdpf |
v4.7.0 |
Infoblox | Website | infoblox |
v4.4.0 |
Infomaniak | Website | infomaniak |
v4.1.0 |
Internet Initiative Japan | Website | iij |
v1.1.0 |
Internet.bs | Website | internetbs |
v4.5.0 |
INWX | Website | inwx |
v2.0.0 |
Ionos | Website | ionos |
v4.2.0 |
IPv64 | Website | ipv64 |
v4.13.0 |
iwantmyname | Website | iwantmyname |
v4.7.0 |
Joker | Website | joker |
v2.6.0 |
Joohoi's ACME-DNS | Website | acme-dns |
v1.1.0 |
Liara | Website | liara |
v4.10.0 |
Lima-City | Website | limacity |
v4.18.0 |
Linode (v4) | Website | linode |
v1.1.0 |
Liquid Web | Website | liquidweb |
v3.1.0 |
Loopia | Website | loopia |
v4.2.0 |
LuaDNS | Website | luadns |
v3.7.0 |
Mail-in-a-Box | Website | mailinabox |
v4.16.0 |
ManageEngine CloudDNS | Website | manageengine |
v4.21.0 |
Manual | manual |
v0.3.0 | |
Metaname | Website | metaname |
v4.13.0 |
mijn.host | Website | mijnhost |
v4.18.0 |
Mittwald | Website | mittwald |
v1.48.0 |
myaddr.{tools,dev,io} | Website | myaddr |
v4.22.0 |
MyDNS.jp | Website | mydnsjp |
v1.2.0 |
MythicBeasts | Website | mythicbeasts |
v0.3.7 |
Name.com | Website | namedotcom |
v0.5.0 |
Namecheap | Website | namecheap |
v0.3.0 |
Namesilo | Website | namesilo |
v2.7.0 |
NearlyFreeSpeech.NET | Website | nearlyfreespeech |
v4.8.0 |
Netcup | Website | netcup |
v1.1.0 |
Netlify | Website | netlify |
v3.7.0 |
Nicmanager | Website | nicmanager |
v4.5.0 |
NIFCloud | Website | nifcloud |
v1.1.0 |
Njalla | Website | njalla |
v4.3.0 |
Nodion | Website | nodion |
v4.11.0 |
NS1 | Website | ns1 |
v0.4.0 |
Open Telekom Cloud | Website | otc |
v0.4.1 |
Oracle Cloud | Website | oraclecloud |
v2.3.0 |
OVH | Website | ovh |
v0.4.0 |
plesk.com | Website | plesk |
v4.11.0 |
Porkbun | Website | porkbun |
v4.4.0 |
PowerDNS | Website | pdns |
v0.4.0 |
Rackspace | Website | rackspace |
v0.4.0 |
Rain Yun/雨云 | Website | rainyun |
v4.21.0 |
RcodeZero | Website | rcodezero |
v4.13 |
reg.ru | Website | regru |
v3.5.0 |
Regfish | Website | regfish |
v4.20.0 |
RFC2136 | Website | rfc2136 |
v0.3.0 |
RimuHosting | Website | rimuhosting |
v0.3.5 |
Sakura Cloud | Website | sakuracloud |
v1.1.0 |
Scaleway | Website | scaleway |
v3.4.0 |
Selectel | Website | selectel |
v1.2.0 |
Selectel v2 | Website | selectelv2 |
v4.17.0 |
SelfHost.(de|eu) | Website | selfhostde |
v4.19.0 |
Servercow | Website | servercow |
v3.4.0 |
Shellrent | Website | shellrent |
v4.16.0 |
Simply.com | Website | simply |
v4.4.0 |
Sonic | Website | sonic |
v4.4.0 |
Spaceship | Website | spaceship |
v4.22.0 |
Stackpath | Website | stackpath |
v1.1.0 |
Technitium | Website | technitium |
v4.20.0 |
Tencent Cloud DNS | Website | tencentcloud |
v4.6.0 |
Timeweb Cloud | Website | timewebcloud |
v4.20.0 |
TransIP | Website | transip |
v2.0.0 |
UKFast SafeDNS | Website | safedns |
v4.6.0 |
Ultradns | Website | ultradns |
v4.10.0 |
Variomedia | Website | variomedia |
v4.8.0 |
VegaDNS | Website | vegadns |
v1.1.0 |
Vercel | Website | vercel |
v4.7.0 |
Versio.[nl|eu|uk] | Website | versio |
v2.7.0 |
VinylDNS | Website | vinyldns |
v4.4.0 |
VK Cloud | Website | vkcloud |
v4.9.0 |
Volcano Engine/火山引擎 | Website | volcengine |
v4.19.0 |
Vscale | Website | vscale |
v2.0.0 |
Vultr | Website | vultr |
v0.3.1 |
Webnames | Website | webnames |
v4.15.0 |
Websupport | Website | websupport |
v4.10.0 |
WEDOS | Website | wedos |
v4.4.0 |
West.cn/西部数码 | Website | westcn |
v4.21.0 |
Yandex 360 | Website | yandex360 |
v4.14.0 |
Yandex Cloud | Website | yandexcloud |
v4.9.0 |
Yandex PDD | Website | yandex |
v3.7.0 |
Zone.ee | Website | zoneee |
v2.1.0 |
Zonomi | Website | zonomi |
v3.5.0 |
3. webroot SSL 인증서 발급
- 한 서버에서 여러개의 도메인 운영 셋팅이 난이도가 있음
- 서버가 위치한 IDC의 방화벽 정책에 의해 거부가 될 경우 사용 불가
3.1 webroot 설정
# .well-known 디렉토리 생성
[root@nginx] mkdir -p /var/www/letsencrypt/.well-known/acme-challenge
# webroot 경로를 알려주는 letsencrypt.conf 파일생성
# /etc/nginx/snippets/경로에 생성
[root@nginx] vi /etc/nginx/snippets/letsencrypt.conf
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/letsencrypt;
}
# Nginx conf 파일에서 위에서 만든 letsencrypt.conf Include
[root@nginx] vi /etc/nginx/conf.d/myhomepage.conf
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name happist.com www.happist.com;
include /etc/nginx/ssl/letsencrypt.conf;
location / {
return 301 https://www.happist.com$request_uri;
expires epoch;
# return 301 아래에 expires epoch; 설정은 301 리다이렉트가 캐싱 불가 설정
}
}
# 인증서 발급
[root@nginx] certbot certonly --webroot --webroot-path=/var/www/letsencrypt \
-d 사이트명.com -d www.사이트명.com
#-webroot-path > .well-known위치
4. Nginx나 Apache서버를 이용한 인증서 발급
4.1 Certbot 설치
# NGINX Certbot 설치
[root@nginx] apt install certbot python3-certbot-nginx
# Apach Certbot 설치
[root@nginx] apt install certbot python3-certbot-apache
4.2 Nginx나 Apache 서버의 설정
# NGINX 설정
[root@nginx] vi /etc/nginx/conf.d/myhomepage.conf
[root@nginx] nginx -t
[root@nginx] systemctl reload nginx
# Apache 설정
[root@nginx] vi /etc/apache2/conf/extra/httpd-vhosts.conf
[root@nginx] apachectl configtest
[root@nginx] systemctl restart httpd
4.3 방화벽 HTTPS 포트 허용
# Ubuntu 방화벽
[root@nginx] ufw allow 'Nginx Full'
# Iptable 방화벽
[root@nginx] vi /etc/iptables/rules.v4
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
4.4 인증서 발급 및 자동 갱신
# Nginx 인증서 발급
[root@nginx] certbot --nginx -d 사이트명.com -d www.사이트명.com
# Apache 인증서 발급
[root@nginx] certbot --apache d 사이트명.com -d www.사이트명.com
# 자동 갱신 > 아래의 명령으로 크론잡을 만들어주면 된다.
[root@nginx] certbot renew --dry-run
5 Standalone 인증서 발급
해당 인증서 발급 방법은 인증서를 발급 받는 동안 웹서버 서비스를 중단해야 한다.
5.1 한개의 도메인 인증서 발급
[root@nginx] systemctl stop nginx
[root@nginx] certbot certonly --standalone -d 사이트명.com -d www.사이트명.com -d webmail.사이트명.com
[root@nginx] systemctl start nginx
5.2 여러개의 도메인 인증서 발급
[root@nginx] systemctl stop nginx
[root@nginx] certbot certonly –standalone -d myhome.com -d http://www.myhome.com -d sp1.com -d http://www.sp1.com -d sp2.kr -d http://www.sp2.kr
[root@nginx] systemctl start nginx
위와 같이 여러개의 사이트를 하나의 인증서로 인증을 받을시 맨 앞에 위치한 사이트명으로 인증서가 발급된다.
그로 인한 문제점은 사이트가 삭제 되거나 추가 될 경우 문제가 발생으로 한다.
[root@nginx] systemctl stop nginx
[root@nginx] certbot certonly --standalone -d myhome.com -d www.myhome.com
[root@nginx] certbot certonly --standalone -d sp.com -d www.sp.com
[root@nginx] certbot certonly --standalone -d sp1.kr -d www.sp1.kr
[root@nginx] systemctl start nginx
위와 같이 서비스별로 생성을 하여 관리 해주는 것이 맞을거 같다.
6. DNS API를 이용한 발급
2번 항목의 DNS Provider 목록으로 검색하여 인증서를 생성 하면 된다.
https://dreamsea77.tistory.com/378
[Ubuntu]Ubuntu 20.04 Let’s Encrypt SSL 인증서 4가지 발급 방법
1. Let’s Encrypt SSL 인증서 발급 방법1. 1 webroot . 사이트 디렉토리 내에 인증서 유효성을 확인할 수 있는 파일을 업로드하여 인증서를 발급하는 방법. 실제 작동하고 있는 웹서버의 특정 데렉토리
dreamsea77.tistory.com
'System > Linux' 카테고리의 다른 글
[Ubuntu]Ubuntu 20.04 Let’s Encrypt 설치 및 발급 (0) | 2025.02.14 |
---|---|
[UBUNTU22.04]DOCKER 설치 (0) | 2023.10.20 |
[Haproxy]Ubuntu 20.04 Haproxy 2.6 설치 및 설정 (0) | 2022.11.02 |
SHFS - 원격 디렉토리 마운트 사용 방법 (0) | 2022.10.19 |
[Ubunut]ubuntu 20.04 부트로더 복구 (0) | 2022.05.26 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- nginx
- letsencrypt
- 인증서자동갱신
- 인증서설치
- camelcase
- Intellj들여쓰기
- 마이바티스
- Letsencrypt wildcard auto renew
- letencrypt
- SSL인증서
- Letsencrypt+nginx
- 마이바티스CamelCase
- SSL
- #logback
- Letsencrypt wildcard
- logstash
- elk8.x
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함