11.Nas_1




★★ 2차업 성공[Synology] 시놀로지에 Let's Encrypt 와일드카드 인증서 cafe24 적용하기 자동화 하기★★

♨ 카랜더 일정 :
  • 링크

  • 첨부

  • 컨텐츠 정보

    본문

    최종업데이트 정보는 

    https://11q.kr/www/bbs/board.php?bo_table=s11&wr_id=11322

    ============

    ★★ 조금간단 [Synology] 시놀로지에 Let's Encrypt 와일드카드 인증서 cafe24 dns적용 매주업데이트 자동화 하기★★ 

    ** 무슨 문제인지 업데이트 안되고 있습니다./


    https://blog.naver.com/jcjee2004/221831609605
    에 기준으로 작업시용 하다 서버 변경 재적용 하니  안되어 

    출처: https://siane.tistory.com/254 [SIAne]

    에서 참고 하여 작업 진행 했습니다.

    인증서 만료 자동화 업데이트 최고의 선택입니다

    ==============  재정리 합니다 ================

    사용호스트 : cafe24

    장비 : 시놀로지 ds918+ 정품sn +  EsSxi 서버

    도메인 구입 이름 :11q.kr

    도메인 등록 업체 : https://hosting.cafe24.com/?controller=myservice_domain_vservice&method=dnsManager&serverMode=&domain=11q.kr&searchDomain=&selectedViewArea=div_txt

    구글검정 링크 : https://toolbox.googleapps.com/apps/dig/#TXT/_acme-challenge.11q.kr


    < 파일 acme.sh 다운준비>

    cd /var/services/homes/shimss/

    에 다운 저장 합니다


    SSH -> acme.sh 스크립트 설치

    $ wget https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh

    실행권한 부여

    $ sudo chmod a+x acme.sh



    < 전체 명령어>

    자신의  다운저장한  homes/유저 경로로 경로 변경 실행

    /var/services/homes/shimss/acme.sh --set-default-ca --server letsencrypt

    3232235521_1634826924.9109.png


    < 도메인 등록 업체  등록전 >

    /var/services/homes/shimss/shimss/acme.sh --issue --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt

    3232235521_1634827165.4156.png


    root@https11qkr:/etc/ssl/certs# /var/services/homes/shimss/acme.sh --set-default-ca --server letsencrypt
    touch: cannot touch '/root/.acme.sh/account.conf': No such file or directory
    grep: /root/.acme.sh/account.conf: No such file or directory
    grep: /root/.acme.sh/account.conf: No such file or directory
    /var/services/homes/shimss/acme.sh: line 2249: /root/.acme.sh/account.conf: No such file or directory
    grep: /root/.acme.sh/account.conf: No such file or directory
    [Thu Oct 21 23:32:49 KST 2021] Changed default CA to: https://acme-v02.api.letsencrypt.org/directory
    root@https11qkr:/etc/ssl/certs# /var/services/homes/shimss/shimss/acme.sh --issue --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    [Thu Oct 21 23:38:57 KST 2021] Using CA: https://acme-v02.api.letsencrypt.org/directory
    [Thu Oct 21 23:38:57 KST 2021] Create account key ok.
    [Thu Oct 21 23:38:57 KST 2021] Registering account: https://acme-v02.api.letsencrypt.org/directory
    [Thu Oct 21 23:38:59 KST 2021] Registered
    [Thu Oct 21 23:38:59 KST 2021] ACCOUNT_THUMBPRINT='AbGb2dIAuFs5Yn5zmGuHbY4JtosWWrTwizWWggqRrtc'
    [Thu Oct 21 23:38:59 KST 2021] Creating domain key
    [Thu Oct 21 23:38:59 KST 2021] The domain key is here: /root/.acme.sh/11q.kr/11q.kr.key
    [Thu Oct 21 23:38:59 KST 2021] Multi domain='DNS:11q.kr,DNS:*.11q.kr'
    [Thu Oct 21 23:38:59 KST 2021] Getting domain auth token for each domain
    [Thu Oct 21 23:39:01 KST 2021] Getting webroot for domain='11q.kr'
    [Thu Oct 21 23:39:01 KST 2021] Getting webroot for domain='*.11q.kr'
    [Thu Oct 21 23:39:01 KST 2021] Add the following TXT record:
    [Thu Oct 21 23:39:01 KST 2021] Domain: '_acme-challenge.11q.kr'
    [Thu Oct 21 23:39:01 KST 2021] TXT value: 'pEUJssQi0P1W2dwgCxKI3RIm1fesAPWlAzD2gNe6yt0'
    [Thu Oct 21 23:39:01 KST 2021] Please be aware that you prepend _acme-challenge. before your domain
    [Thu Oct 21 23:39:01 KST 2021] so the resulting subdomain will be: _acme-challenge.11q.kr
    [Thu Oct 21 23:39:01 KST 2021] Add the following TXT record:
    [Thu Oct 21 23:39:01 KST 2021] Domain: '_acme-challenge.11q.kr'
    [Thu Oct 21 23:39:01 KST 2021] TXT value: 'xhE9U4TxpJy00awdccslbkcPjtn3vWogH4aE71Zx2z0'
    [Thu Oct 21 23:39:01 KST 2021] Please be aware that you prepend _acme-challenge. before your domain
    [Thu Oct 21 23:39:01 KST 2021] so the resulting subdomain will be: _acme-challenge.11q.kr
    [Thu Oct 21 23:39:01 KST 2021] Please add the TXT records to the domains, and re-run with --renew.
    [Thu Oct 21 23:39:01 KST 2021] Please add '--debug' or '--log' to check more details.
    [Thu Oct 21 23:39:01 KST 2021] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh
    root@https11qkr:/etc/ssl/certs#

    cafe24 ddns  등록 업체 등록
    상기 코드를 등록을 위하여 기존 삭제후 
    도메인먼저 등록후
    2번 등록 합니다
    3232235521_1634827366.0606.png
    3232235521_1634827985.4172.png
    등록 확인
    root@https11qkr:/etc/ssl/certs# nslookup
    > set type=txt
    > _acme-challenge.11q.kr
    Server:         8.8.8.8
    Address:        8.8.8.8#53
    Non-authoritative answer:
    _acme-challenge.11q.kr  text = "pEUJssQi0P1W2dwgCxKI3RIm1fesAPWlAzD2gNe6yt0"
    _acme-challenge.11q.kr  text = "xhE9U4TxpJy00awdccslbkcPjtn3vWogH4aE71Zx2z0"
    Authoritative answers can be found from:
    >
    3232235521_1634828021.4224.png

    TXT레코드 등록확인 후 최종 갱신(발급)..이후 매일 사용
    $ /var/services/homes/사용자 이름/acme.sh --renew --dns --force -d 내 도메인 -d *.내 도메인 --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt

    /var/services/homes/shimss/shimss/acme.sh --renew --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt

    3232235521_1634828248.5116.png

    -----END CERTIFICATE-----
    [Thu Oct 21 23:57:05 KST 2021] Your cert is in: /root/.acme.sh/11q.kr/11q.kr.cer
    [Thu Oct 21 23:57:05 KST 2021] Your cert key is in: /root/.acme.sh/11q.kr/11q.kr.key
    [Thu Oct 21 23:57:05 KST 2021] The intermediate CA cert is in: /root/.acme.sh/11q.kr/ca.cer
    [Thu Oct 21 23:57:05 KST 2021] And the full chain certs is there: /root/.acme.sh/11q.kr/fullchain.cer
    root@https11qkr:/etc/ssl/certs#

    에 저장 되네요  성공 입니다


    구글 검증 (cafe24시 바로 등록후 변동확인)

    3232235521_1634828523.3842.png
    인증서 바로 생성
    /var/services/homes/shimss/acme.sh --renew --dns --force -d 11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --debug



    디폴트 인증서 위치 확인

    root@https11qkr:/etc/ssl/certs# cat /usr/syno/etc/certificate/_archive/DEFAULT
    2P8uzH
    root@https11qkr:/etc/ssl/certs#


    제어판 작업스케쥴러에 복사 매일  실행 합니다
    # ============================
    # 자동화 파일 만드어 자동스케쥴러에 복사 예약된 작업에 등록 합니다
    # 저는 매주 금요일마다 돌게끔 설정했습니다.
    # 인증서 갱신
    cd /var/services/homes/shimss/
    #/var/services/homes/사용자   /acme.sh --renew --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    #[Thu Oct 21 23:57:05 KST 2021] The intermediate CA cert is in: /root/.acme.sh/11q.kr/ca.cer
    #[Thu Oct 21 23:57:05 KST 2021] And the full chain certs is there: /root/.acme.sh/11q.kr/fullchain.cer
    cat /usr/syno/etc/certificate/_archive/DEFAULT
    #2P8uzH
    #  디볼트 복사 진행  합니다
    /var/services/homes/shimss/acme.sh --renew --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    # 결과 복사
    #[Thu Oct 21 23:57:05 KST 2021] Your cert is in: /root/.acme.sh/11q.kr/11q.kr.cer
    #[Thu Oct 21 23:57:05 KST 2021] Your cert key is in: /root/.acme.sh/11q.kr/11q.kr.key
    #로 다운되면  갱신된 인증서를 시놀로지에 등록 파일
    # 기본 인증서로 정의된 것 폴더이름 확인  복사 지정 합니다
    # ============================
    /bin/cp /root/.acme.sh/11q.kr/11q.kr.cer  /usr/syno/etc/certificate/_archive/2P8uzH/cert.pem
    /bin/cp /root/.acme.sh/11q.kr/11q.kr.key /usr/syno/etc/certificate/_archive/2P8uzH/privkey.pem
    /bin/cp /root/.acme.sh/11q.kr/ca.cer /usr/syno/etc/certificate/_archive/2P8uzH/chain.pem
    /bin/cp /root/.acme.sh/11q.kr/fullchain.cer  /usr/syno/etc/certificate/_archive/2P8uzH/fullchain.pem
    # nginx 서비스 재시작
    #/usr/syno/sbin/synoservicectl --reload nginx

    # =======================


    <기타 정보>


    인증서 다운로드 설치는 상기 명령으로 만드어진 경로 확인

    1) 기본 인증서로 정의된 것 폴더이름

    cat /usr/syno/etc/certificate/_archive/DEFAULT

    YNLU36



    2)  기본 인증서로 정의된 것이 기본인증 파일 폴더 

      cd /usr/syno/etc/certificate/system/default

      

    3) 저장된 여러개 인증서

     cd /usr/syno/etc/certificate/_archive


    내보내기 불러오기 참조 경로

    3232235521_1631027708.5667.png


    기본 인증서로 변경 후 적용 기본 인증서로 변경 성공

    3232235521_1631030044.3811.png

    저장위치 

    cd /root/.acme.sh/11q.kr/

    3232235521_1634836140.9263.png


    기본인증서로 복사 폴더 확인

    cd /usr/syno/etc/certificate/_archive/

    cat DEFAULT

    3232235521_1634836350.6487.png


    Apache 2.2 & 2.4 패키지 오류와 관련하여 

    제어판 >  작업 스케줄러  > 루트 로 사용자 정의 스크립트 생성

     또는 SSH에서 루트로 서비스를 다시 시작하기 위해 다음 명령을 실행할 수 있습니다 .  

    synosystemctl restart syslog-ng

    ========================

    전후 비교

    3232235521_1634836485.2511.png


    3232235521_1634831774.173.png

    3232235521_1634836529.3077.png



    작업 스케줄러 실행후 전 파일 검증

    nano  auto_LetsEncrypt.sh

    chmod a+x  auto_LetsEncrypt.sh

    ---------------

    아래를 파일로 만들어 테스트 후 적용

    ============ auto_LetsEncrypt.sh ===============

    root@https11qkr:/# cat auto_LetsEncrypt.sh

    ==================================================

    # 자동화 파일 만드어 자동스케쥴러에 복사 예약된 작업에 등록 합니다

    # wget https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh

    # chmod a+x acme.sh


    # 1차 생성 도메인업체 등록 전 txt 등록 정보 확인

    /var/services/homes/shimss/acme.sh --renew --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough->


    # 도메인 업체 등록후 연결확인

    nslookup

    # 저는 매일 생성  설정했습니다.


    # 인증서 갱신 작업 폴더

    cd /var/services/homes/shimss/


    # 생성 도메인업체 등록후 2번째 실행

    #/var/services/homes/사용자   /acme.sh --renew --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-eno>

    #/var/services/homes/shimss/acme.sh --renew --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough>


    # 결과 복사

    #[Thu Oct 21 23:57:05 KST 2021] The intermediate CA cert is in: /root/.acme.sh/11q.kr/ca.cer

    #[Thu Oct 21 23:57:05 KST 2021] And the full chain certs is there: /root/.acme.sh/11q.kr/fullchain.cer

    #[Thu Oct 21 23:57:05 KST 2021] Your cert is in: /root/.acme.sh/11q.kr/11q.kr.cer

    #[Thu Oct 21 23:57:05 KST 2021] Your cert key is in: /root/.acme.sh/11q.kr/11q.kr.key

    # 로 다운되면  갱신된 인증서를 시놀로지에 등록 파일

    # 기본 인증서로 정의된 것 폴더이름 확인 디폴트에  복사 지정 합니다


    # 인증서 디폴트 확인

    cat /usr/syno/etc/certificate/_archive/DEFAULT

    #2P8uzH


    #  디볼트로  복사 진행  합니다

    # ============================

    /bin/cp /root/.acme.sh/11q.kr/11q.kr.cer  /usr/syno/etc/certificate/_archive/2P8uzH/cert.pem

    /bin/cp /root/.acme.sh/11q.kr/11q.kr.key /usr/syno/etc/certificate/_archive/2P8uzH/privkey.pem

    /bin/cp /root/.acme.sh/11q.kr/ca.cer /usr/syno/etc/certificate/_archive/2P8uzH/chain.pem

    /bin/cp /root/.acme.sh/11q.kr/fullchain.cer  /usr/syno/etc/certificate/_archive/2P8uzH/fullchain.pem


    # nginx 서비스 재시작

    synosystemctl restart syslog-ng


    # file_check

    ls -l /root/.acme.sh/11q.kr/

    cat /usr/syno/etc/certificate/_archive/DEFAULT

    ls -l /usr/syno/etc/certificate/_archive/2P8uzH/

    # =======================



    root@https11qkr:/#

    ./auto_LetsEncrypt.sh

    =

    파일 비교

    3232235521_1634836929.3581.png

    3232235521_1634838411.5771.png


    작업 스케줄러 생성시 > root 로 해야 동작 합니다
    3232235521_1634837044.3213.png

    매일 생성
    3232235521_1634837083.5658.png

    검증한 sh파일로 등록


    3232235521_1634837119.3585.png


    제어판 > 보안 > 인증서

    3232235521_1634837200.9685.png

    3232235521_1634837469.5933.png

    =================  성공 입니다 ============================

    [ 추가 정보 ... 더보기) ]
    뷰PDF 1,2



    office view

    관련자료

    댓글목록

    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일


    9/8일 확인

    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일

    9/9일 생성 확인

    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일

    90일 일자 계산 9/9일 + 90일 12/8일 입니다
    https://superkts.com/cal/days/20210909 90

    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일

    9월 30일자로 root ca 인증서가 만료되서 난리네요;
    https://www.2cpu.co.kr/nas/35070
    오류해결) 오래된 기기에서 Let's Encrypt 미지원 이슈
    https://hi098123.tistory.com/436

    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일

    날짜 계산
    https://superkts.com/cal/days/20211004 90
    2021년 10월 4일(월)의
    90일 후는
    2022년 1월 2일(일) 입니다.

    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일
    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일

    DSM 6.2.x Let's Encrypt 인증서 발급 오류 수정
    https://blog.leenit.kr/adding-synology-dsm-lets-encrypt-isrgrootx1/

    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일

    Apache 2.2 & 2.4 패키지 오류와 관련하여 제어판 >  작업 스케줄러  > 루트 로 사용자 정의 스크립트 생성 또는 SSH에서 루트로 서비스를 다시 시작하기 위해 다음 명령을 실행할 수 있습니다 . 
    synosystemctl restart syslog-ng




    • 일간 조회수
        • 게시물이 없습니다.
    • 주간 조회수
        • 게시물이 없습니다.
    • 월간 조회수
        • 게시물이 없습니다.


    Total 1,746 / 7 Page
    [ 추천● 작업성공[Docker추천-14] GPS위치 추적 traccar서버 사용방법및 ] 댓글 10

    ● 작업)[Docker추천-14] GPS위치 추적traccar서버 사용방법및 트래커 이동경로보고서 마커표시 이동경로 확인하기 무료위치추적. 구글…

    [ ● ESXi에서 CPU 주파수를 낮추어 소비전력 확인하는 주파수 확인방법 ] 댓글 2

    ●ESXi에서 CPU 주파수를 낮추어 소비전력 확인하는 주파수 확인방법 및 효과서버에 고사양pc사양에서 소비전력을 다운하고자 clock을 다운 …

    [ ● ESX 및 인텔 터보 부스트 및 ESXi에서 CPU 주파수를 확인하는 방법 ]

    ●ESX 및 인텔 터보 부스트 및ESXi에서 CPU 주파수를 확인하는 방법-ESXi에서 CPU 주파수를 확인하는 방법esxcfg-info -w …

    [ ●작업성공) docker 의 연결 정보 telegram 메세지 message 전송 ]

    ● docker 의 연결 정보 telegram 메세지 message 전송 도커의 start/ stop 정보를 전송 합니다 ▶ portainer …

    [ 설치작업성공● speedtest - docker 설치 모니터링 설치방법 portainer stack 으… ] 댓글 2

    설치작업● speedtest - docker 설치 모니터링 설치방법 portainer stack 으로 설치 방법설치 방법 portainer로 접…

    [ ● Esxi server veeam 백업 프로그램 다운로드 설치방법 ]

    ● Esxi server veeam 백업 프로그램 다운로드 설치방법헤놀로지 설치 가동에 VMDK 백업으로 작업 진행 합니다1.Esxi serve…

    [ ● Esxi server veeam 백업 프로그램 다운로드 방법 ]

    ● Esxi server veeam 백업 프로그램 다운로드 방법 헤놀로지 설치 가동에 VMDK 백업으로 작업 진행 합니다1.Esxi server…

    [ 작업성공● VMWARE ESXI 6.7 설치로 RealTek 랜인식및 tinycore 0.46 으로 설치 … ] 댓글 1

    ● VMWARE ESXI 6.7 설치로 RealTek 랜인식및 tinycore 0.46 으로 설치 빌드작업 성공 작업 기입니다 본작업은 그동안 …

    [ ★★ REALTEK 네트워크 어댑터가 있는 서버에 VMWARE ESXI 6.7 설치.★★ ] 댓글 8

    ●REALTEK 네트워크 어댑터가 있는 서버에 VMWARE ESXI 6.7 설치.ESXi 7.0은 Realtek 사의 LAN 칩을 지원하지 않는…

    [ ● disk1번으로 이동성공)tinycore_redpill 부트로더 esxi 서버7.0에서 sata1,2 추… ] 댓글 10

    ●disk1번으로 이동성공)tinycore_redpill 부트로더 esxi 서버7.0에서 sata1,2 추가로 HDD_data의 disk1 하드…

    [ ● esxi ESXi에 대한 SNMP 구성 시작 설정하기 ]

    ●esxiESXi에 대한 SNMP 구성 시작 설정하기ESXi에 대한 SNMP 구성라이브러리에 추가PDF 다운로드피드백업데이트 날짜:2019년05…

    [ ● 시놀로지 알림 설정으로 이밴트 카톡으로 받기 지메일/카카오메일 설정하기 ]

    ● 시놀로지 알림 설정으로 이밴트 카톡으로 받기 (1) 이밴트에 지메일 설정 > 이메일 수신 테스트 설정입니다(2) 구글 이메일 2단계 인…

    [ v26★★★ dsm7.1만능 부트로더 Ver 0.4.6 버전과 tr_st.sh 업데이트)tinycore_re… ] 댓글 82

    ● 만능 부트로더Ver 0.4.6.0 버전업)tinycore_redpill_v046_by_11qkr_v22 구성파일자료 이동합니다https://…


    ♥간단_메모글♥


    최근글


    새댓글



    PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
    ▶ 2024-04-24 15:43:54

    오늘의 홈 현황


    • 현재 접속자♨ 90 명
    • 오늘 가입자※ 0 명
    • 어제 가입자※ 9 명
    • 주간 가입자※ 24 명
    • 오늘 방문자 972 명
    • 어제 방문자 1,421 명
    • 최대 방문자 13,042 명
    • 전체 방문자 4,286,351 명
    • 전체 게시물※ 8,531 개
    • 전체 댓글수※ 24,508 개
    • 전체 회원수 10,927 명

    QR코드


    ☞ QR코드 스캔은 kakao앱 자체 QR코드

    알림 0








    최신글↑