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 / 5 Page
    [ ● 시놀로지 도커 nextcloud 설치 2단계) 크롬 접속 https 주의요함 및 접속 불가로 let… ]

    ● 시놀로지 도커 nextcloud 설치 2단계) 크롬 접속 https 주의요함 및 접속 불가로 lets 인증서 연결하기시놀로지 도커 설치 이름…

    [ ●시놀로지작업) Nextcloud 인스턴스는 현재 점검 모드 유지 보수 모드 그리고 설치 조건 ]

    ●시놀로지작업)Nextcloud 인스턴스는 현재 점검 모드유지 보수 모드 그리고 설치 조건시놀로지 도커 사용조건업데이트 유지 보수(ssh 조건)…

    [ ● 작업)synology nas ssd cache 온도로 인한 shutdown 해결 정보 및 cpu dis… ]

    ● 작업 설정)synology nas ssd cache 온도로 인한 shutdown 해결 정보--> 링크 정보를 근거로 설정해봅니다 // …

    [ ● SynoCommunity SynoCIi Monitor Tools 설치 하여 랜속도 시스템 응답 확인… ]

    ●SynoCommunitySynoCIi Monitor Tools 설치 하여 랜속도시스템 응답 확인 하기dsm7.0에서 동작중인패키지 소스 추가하…

    [ ●추가 네트워크 드라이버로 사용자 지정 ESXi 설치 관리자 이미지 생성 ]

    ●추가 네트워크 드라이버로 사용자 지정 ESXi 설치 관리자 이미지 생성서버에 공식 VMware HCL에 없는 네트워크 카드가 있는 경우 ESX…

    [ ● [VMWare] esxi 서버 멈춤증상 확인 check 하기 ] 댓글 1

    ●[VMWare] esxi 서버 멈춤증상 확인 check 하기 하드웨어는 메인보드에서 로그 확인해 보시면 되고(조립머신이면 없을 확률이 높습니다…

    [ ● svchost.exe 동작확인 하기 네트워크 동작 중지및 일부 프로그램 강제종료 중지 건 ]

    ● svchost.exe 동작확인 하기 네트워크 동작 중지및 일부 프로그램 강제종료 중지 건svchost.exe 가 윈도우에서 왜 많이 실행되고…

    [ ●DSM 7에서 DSM 6으로 다운그레이드 및 응급 복구 방법 ]

    ●DSM 7에서 DSM 6으로 다운그레이드 및 응급 복구 방법https://www.blackvoid.club/dsm-7-to-dsm-6-down…

    [ ● 시놀로지 포토스테이션 사진 폴더 DSM7 photo에 사진 초기 설정 추가 하기 ]

    ● 시놀로지 포토스테이션 사진 폴더 DSM7 photo에 사진 초기 설정 추가 하기dsm7에서 사진 관리 방법을 정리 합니다 기본 초기 설치후 …

    [ ● 동기화 Syncthing를 시놀로지 도커에서 설치 pc 핸드폰 폴더 공유하기 ] 댓글 2

    ● 동기화Syncthing를 시놀로지도커에서 설치 pc 핸드폰 photo 폴더 공유하기Syncthing은 기존의 사유(私有) 동기화 / 클라우드…

    [ ● android-studio-2021.2.1.14-windows.exe 설치작업 ]

    ●android-studio-2021.2.1.14-windows.exe 설치작업android-studio 검색 다운로드 exe 파일 다운로드 합…

    [ ● LETSENCRYPT SSL 인증서 자동갱신 쉘스크립트 ]

    ●LETSENCRYPT SSL 인증서 자동갱신 쉘스크립트출처:https://ivps.tistory.com/629[iVPS 가상서버호스팅] htt…

    [ ● 듀얼랜 활용법 참고자료 활용 테스트(저의 esxi 서버에서는 효과가 없다) ]

    ●듀얼랜 활용법 참고자료 활용 테스트1차 설정저의 esxi 서버에서는 효과가 없다입니다2차 점검esxi 서버의 랜설정 다른 카드이름으로 필요처음…

    [ ● DSM 7.1 Active Backup for Business 패키지설치 activated 활성화 작… ] 댓글 3

    ● DSM 7.1 Active Backup for Business 패키지설치 activated 활성화1) 패키지 설치 2) 실행열기히면 시놀로지…


    ♥간단_메모글♥


    최근글


    새댓글



    PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
    ▶ 2024-04-19 22:27:48

    오늘의 홈 현황


    • 현재 접속자♨ 181 명
    • 오늘 가입자※ 2 명
    • 어제 가입자※ 7 명
    • 주간 가입자※ 16 명
    • 오늘 방문자 2,164 명
    • 어제 방문자 2,103 명
    • 최대 방문자 13,042 명
    • 전체 방문자 4,278,822 명
    • 전체 게시물※ 8,522 개
    • 전체 댓글수※ 24,482 개
    • 전체 회원수 10,912 명

    QR코드


    ☞ 사진기로 촬영하시면 방문링크 됩니다

    알림 0








    최신글↑