yeonghoon.kim

  • 게시판
  • 갤러리
  • aws

CentOS8 Let's Encrypt 적용 - nginx, certbot 이용

김영훈 2019.10.31 18:27 조회 수 : 2444

1. mod_s​sl 설치

yum install -y mod_ssl

 

2. Certbot 설치

mkdir /usr/local/certbot
cd /usr/local/certbot
wget https://dl.eff.org/certbot-auto
chmod 755 certbot-auto

 

3. Certbot 사용전 업데이트(단순 실행)

./certbot-auto

Error while running apachectl configtest.

AH00526: Syntax error on line 85 of /etc/httpd/conf.d/ssl.conf:
SSLCertificateFile: file '/etc/pki/tls/certs/localhost.crt' does not exist or is empty


How would you like to authenticate and install certificates?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Apache Web Server plugin (apache) [Misconfigured]
2: Nginx Web Server plugin (nginx)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): c

 

*일단 기본 패키지 설치를 위해 실행한 것이므로 여기서 중단 

4. nginx 플러그인을 이용하여 인증서 발급

./certbot-auto --nginx --register-unsafely-without-email
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: a



Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: db.25ni.pe.kr
2: dns.25ni.pe.kr
3: mail.25ni.pe.kr
4: yeonghoon.kim
5: data.yeonghoon.kim
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 4

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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

 리다이렉트를 선택할 경우 알아서 nginx 설정을 바꿔줌.

 server {
    if ($host = yeonghoon.kim) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen       80;
    server_name  yeonghoon.kim;
    return 404; # managed by Certbot
}

 5. nginx 재구동 후 정상적으로 작동하는지 확인

service nginx restart

 

 

nginx 패키지 설치 기준이므로 소스 설치를 했을 경우 수동으로 발급할 것


  • 추천 0

  • 비추천 0
이 게시물을
목록

댓글 0

사진 및 파일 첨부

여기에 파일을 끌어 놓거나 왼쪽의 버튼을 클릭하세요.

파일 용량 제한 : 0MB (허용 확장자 : *.*)

업로드 중... (0%)

0개 첨부 됨 ( / )
 
번호 제목 글쓴이 날짜 조회 수
공지 2025 일본 여행 계획 김영훈 2024.10.10 986
공지 현금, 저축, 투자, 지출, 예산, 보험 내역(2024-05-30) 김영훈 2024.03.10 639
45 CentOS7 Google Authenticator(구글 OTP) SSH 적용 김영훈 2019.11.10 119
44 CentOS7 MariaDB 설치 및 설정(RPM) 김영훈 2019.11.10 124
43 CentOS7 BIND 1차, 2차 구성 김영훈 2019.11.10 94
42 CentOS7 메일 서버 구축 #3 - 도메인 레코드 설정 및 수발신 테스트 김영훈 2019.11.10 138
41 CentOS7 메일 서버 구축 #2 - Dovecot 설치 및 설정 김영훈 2019.11.10 100
40 CentOS7 메일 서버 구축 #1 - Sendmail 설치 및 설정 김영훈 2019.11.10 124
39 CentOS7 BIND 설치 및 설정 김영훈 2019.11.10 112
38 도메인 구매 및 사용 방법 김영훈 2019.11.10 240
37 CentOS7 네트워크 장치명 변경(eth0) 김영훈 2019.11.10 140
36 CentOS7 vsftpd 설치 및 설정 김영훈 2019.11.10 186
35 CentOS7 설치 후 기본 설정 김영훈 2019.11.10 159
34 CentOS7 Minimal 설치 및 네트워크 설정 김영훈 2019.11.10 211
33 kvm virt-install 예시 김영훈 2019.11.10 112
32 SSH 클라이언트 소개 및 서버 접속 방법 김영훈 2019.11.10 213
31 sendmail 구동 안되는 현상 김영훈 2019.11.07 267
30 nginx 443 -> 80 리다이렉트 김영훈 2019.11.06 116
29 IIS 503 에러 - 응용프로그램풀 죽는 현상 김영훈 2019.11.04 423
28 엑셀 줄바꿈(alt + enter) 찾기 김영훈 2019.11.04 111
» CentOS8 Let's Encrypt 적용 - nginx, certbot 이용 김영훈 2019.10.31 2444
26 배달의민족 사용 금액 김영훈 2019.10.31 123
쓰기 태그
 첫 페이지 5 6 7 8 9 10 11 12 13 14 끝 페이지