본문 바로가기

서버

vue + nginx + certbot

 

certbot 사용법

 

설치후 실행 => 혹시 몰라서 관리자 모드로 실행했다

 

사용에대한 동의서 뭐 기타등등을 메일로 보낼테니 입력하라해서

입력하고

 

url 입력

 

 

C:\Program Files (x86)\Certbot>certbot certonly --manual
Saving debug log to C:\Certbot\log\letsencrypt.log
Please enter the domain name(s) you would like on your certificate (comma and/or
space separated) (Enter 'c' to cancel): https 신청할 url
Requesting a certificate for app.sparkpluswash.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Create a file containing just this data:

abc.dd


And make it available on your web server at this URL:

http://app.sparkpluswash.com/.well-known/acme-challenge/abc

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue

 

*********

내가 검색한 결과로 nignx 의 root 파일 아래에 .well-known/acme-challenge/ 폴더 생성후

abc라는 파일을 만들고 abc 안의 내용에

abc.dd

이 내용을 넣으면 된다.

 

nginx의 root 설정 폴더 아래에 넣으면 되는데

다른곳의 예시만 보고.. nginx/html에 넣으니 안되는것이었다

 

만약 nginx의 서버 설정이 이렇게 되어 있다면

server {
       listen       80;
       server_name  'hahahaha.com';
 
           location / {
            root   D:\sample\dist;
            index  index.html;
        }
    }

 

D:\sample\dist 아래에

/.well-known/acme-challenge/ 이 폴더를 생성하고

txt 파일이 아닌 일반 파일 abc 생성후  abc.dd 라는 내용을넣어주니 완료!

 

 


Successfully received certificate.
Certificate is saved at: C:\Certbot\live\https 신청할 url\fullchain.pem
Key is saved at:         C:\Certbot\live\https 신청할 url\privkey.pem
This certificate expires on 2022-10-07.
These files will be updated when the certificate renews.

NEXT STEPS:
- This certificate will not be renewed automatically. Autorenewal of --manual certificates requires the use of an authentication hook script (--manual-auth-hook) but one was not provided. To renew this certificate, repeat this same certbot command before the certificate's expiry date.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 

머 잘 생성됐다 라는 얘기가 뜨면

 

server {
       listen       443 ssl;
       server_name  'hahahaha.com';

       ssl_certificate      C:\Certbot\live\hahahaha.com\cert.pem;
       ssl_certificate_key  C:\Certbot\live\hahahaha.com\privkey.pem;

       ssl_session_cache    shared:SSL:1m;
       ssl_session_timeout  5m;

       ssl_ciphers  HIGH:!aNULL:!MD5;
       ssl_prefer_server_ciphers  on;

           location / {
            root   D:\sample\dist;
            index  index.html;
        }
    }

이런식으로 설정해주면 끝!!

(다른 블로그에서 ssl on;) 이라는 설정 부분이 있는데 이건 버전이 낮을때..

 

일줄 알았느나 timeout 에러 떠서 확인해보니 공유기에서 443 포트 열어줘야했다

(이 부분에서 2시간 소요) ㅋㅋㅋ

거기까지 끝내니 작동 잘된다!

 

 

'서버' 카테고리의 다른 글

gitlab 명령어 및 에러  (0) 2022.08.11
nginx 멀티 ssl 포트  (0) 2022.07.28
nginx window 서비스 등록  (0) 2022.07.28
pm2 윈도우 서비스 등록  (0) 2022.07.28
window cerbot 자동 갱신  (0) 2022.07.09