본문 바로가기

개인공부

https certbot 을 이용해 배포하기

반응형

다음 명령어를 이용해서 리눅스 버전을 확인하자.

/etc/*release*

 

Cerbot 홈페이지에서 본인에게 맞는 Cerbot 설치방법을 확인하자.

 

https://certbot.eff.org/

 

Certbot

Different Internet services are distinguished by using different TCP port numbers. Unencrypted HTTP normally uses TCP port 80, while encrypted HTTPS normally uses TCP port 443. To use certbot –webroot, certbot –apache, or certbot –nginx, you should h

certbot.eff.org

 

 내버전 - Ubuntu 18.04.1 LTS 설치방법 

 

밑에는 내버전에 맞는 사용법을 그대로 가져온것이고 문제가 없다면 실행될것이다.

여기서 중요한점은 접속하는 URL이 DNS 도메인을 가져야한다는 것! 그러지않으면

HTTPS로 배포를 할 수 없다.. 이방법은 구글 검색을 통해서 알아보자.

 

SSH into the server

SSH into the server running your HTTP website as a user with sudo privileges.

 

Add Certbot PPA

You'll need to add the Certbot PPA to your list of repositories. To do so, run the following commands on the command line on the machine:

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update

Install Certbot

Run this command on the command line on the machine to install Certbot.

sudo apt-get install certbot python3-certbot-nginx

Choose how you'd like to run Certbot

Either get and install your certificates...

Run this command to get a certificate and have Certbot edit your Nginx configuration automatically to serve it, turning on HTTPS access in a single step.

 

여기를 하면 설정 같으게 나오는데 본인에게 맞는 설정으로 하면된다.

sudo certbot --nginx

Or, just get a certificate

If you're feeling more conservative and would like to make the changes to your Nginx configuration by hand, run this command.

 

sudo certbot certonly --nginx

Test automatic renewal

The Certbot packages on your system come with a cron job or systemd timer that will renew your certificates automatically before they expire. You will not need to run Certbot again, unless you change your configuration. You can test automatic renewal for your certificates by running this command:

 

sudo certbot renew --dry-run

 

Confirm that Certbot worked

To confirm that your site is set up properly, visit https://yourwebsite.com/ in your browser and look for the lock icon in the URL bar. If you want to check that you have the top-of-the-line installation, you can head to https://www.ssllabs.com/ssltest/.

반응형

'개인공부' 카테고리의 다른 글

Spring Webflux 이란?  (0) 2020.08.12
@어노테이션 만들기!  (0) 2020.08.12
nohup 사용법.  (0) 2020.08.11
Spring mybatis mapper 설정 및 repo 설정  (0) 2020.08.09
lombok을 사용해보자.  (0) 2020.08.09