Letsencrypt 설치
-
Letsencrypt설치
$ sudo apt install letsencrypt
-
인증서 발급받기1 – standalone 방식
$ sudo letsencrypt certonly --standalone -d [yourdomain]
(이 명령어 입력하고 이메일 입력하고 약관에 동의(A)할 경우에만 인증서 발급해줌, 마지막의 메일링리스트 가입동의 Y(예)/N(아니오)는 맘대로)
위 과정을 마치면
/etc/letsencrypt에 ssl인증서가 생김 -
인증서 발급받기2 – 수동인증 방식(DNS)
와일드카드 인증서를 받기 위한 유일한 방법… 인 줄 알았는데… standalone에서도 -d "*.[도메인]" 입력했을 때 넘어간다… ^^;;; 이제 standalone에서도 와일드카드 인증서를 받을 수 있게 된건가?
-
letsencrypt 가 없을 경우 설치 먼저…
# apt install letsencrypt
-
letsencrypt 실행
# letsencrypt certonly --manual --preferred-challenges dns -d "[도메인]" -d "*.[도메인]"
-
내용확인하고 Y/N 선택
-
_acme-challenge.도메인 에 넣으라는 내용이 있는데 DNS서버로 가서 해당 내용을 TXT필드에 넣으면 됨
-
참고로 putty에서 복사/붙여넣기 할 때는
Ctrl+Insert(복사), Shift+Insert(붙여넣기)를 써야 편함 -
다른 터미널 열고 DNS가 정상적으로 작동하는 지 확인
$ host -t txt _acme-challenge.[도메인]
-
-
인증서 발급받기3 – 수동인증 방식(도커사용)
docker run -it --name certbot -v '/etc/letsencrypt:/etc/letsencrypt' \ -v '/var/lib/letsencrypt:/var/lib/letsencrypt' \ certbot/certbot certonly -d '*.[도메인]' --manual --preferred-challenges dns \ --server https://acme-v02.api.letsencrypt.org/directory
-
자동갱신
certbot renew
-
에러처리
-
-d domain unreconized 어쩌구저쩌구…
- 그냥 -d 옵션 빼버리고 수동으로 넣어버렸음;;;
- 알고봤더니… –d (빼기 2개 넣은건 비밀)
-
/etc/letsencrypt/live/ permission denied
- sudo 말고 su로 들어가서 root권한으로 실행해야 됨
-
letsencrypt client with the currently selected authenticator does not support any combination
-
아래처럼 실행
letsencrypt --authenticator standalone --installer apache -d [도메인] --pre-hook "systemctl stop apache2" --post-hook "systemctl start apache2"
-
위 명령어를 실행했는데 (client with the currently… 에러) 실행할 때 에러가 나면 "python-certbot-apache" 설치
sudo apt update sudo apt install python-certbot-apache
-
-