'Ubuntu' 카테고리의 글 목록

Nginx Let's Encrypt SSL 적용하기

실행 환경

- Ubuntu 20.04 / Docker: Ubuntu 20.04 이미지 적용

- nginx에는 이미 http로 도메인 연결이 되어 있다고 가정한다.

 

CERTBOT 적용하여 Let's Encrypt SSL 적용하기

# 설치
$ apt-get install letsencrypt
$ apt-get install python3-certbot-nginx
$ apt-get install certbot

# SSL 인증서 등록
$ certbot --nginx
or
$ certbot --nginx -d [적용할 사이트 이름]

$ service nginx restart
or
$ systemctl restart nginx

# 3개월에 한번씩 갱신 필요
# 테스트 갱신
$ certbot renew --dry-run
# 실제 갱신
$ certbot renew

 

 

Crontab을 사용하여 자동 갱신

# Docker일 경우 crontab 설치 필요
$ apt-get install cron

# Crontab 편집
$ crontab -e

(매월 1일 오전 5시에 실행) - 자세한건 참고링크에서 확인해주세요!
0 5 1 * * /usr/bin/certbot renew --renew-hook="service nginx restart"

# Crontab 보기
$ crontab -l

 

 

참고링크

https://nuggy875.tistory.com/119

 

Nginx로 https 적용하기 (let's encrypt 사용)

- Ubuntu 18.04 LTS 에서 진행 - Ubuntu 20.04 에서 실행 시에도 문제 없었음. - 보유 DNS가 있어야 진행할 수 있음. greenlock 방식이 불안하다는 얘기가 많아서 리버스 프록시 방식의 Nginx를 사용하여 https 인

nuggy875.tistory.com

 

https://nuggy875.tistory.com/133

 

https 인증서 자동 갱신 (Let's Encrypt) (Crontab사용)

https 인증서 발급 및 수동 갱신 방법 https://nuggy875.tistory.com/119 Nginx로 https 적용하기 (let's encrypt 사용) - Ubuntu 18.04 LTS 에서 진행 - Ubuntu 20.04 에서 실행 시에도 문제 없었음. - 보유 DNS가 있어야 진행

nuggy875.tistory.com

 

https://freedeveloper.tistory.com/264

 

[Docker] Crontab 설치

https://codeday.me/ko/qa/20190325/152387.html Cron Job * * * * * root echo "Hello world" >> /var/log/cron.log 2>&1 Dockerfile FROM ubuntu:latest MAINTAINER docker@ekito.fr RUN apt-get update && apt-get -y install cron # Add crontab file in the cron directo

freedeveloper.tistory.com

 

'Ubuntu' 카테고리의 다른 글

Ubuntu 22.04 LTS에 MongoDB 설치하기  (0) 2023.11.26

Ubuntu 22.04 LTS에 MongoDB 설치하기

예전에 개인 Github에 정리해뒀던 내용인데, 블로그에 기록해두기 위해 적는다.
Ubuntu 22.04에서 MongoDB를 설치하는 방법이다.

순서대로 입력합니다

$ wget -qO- https://www.mongodb.org/static/pgp/server-5.0.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/mongo.gpg
$ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
$ sudo apt update
$ sudo apt install -y mongodb-org

위의 과정이 오류 없이 진행 되었다면 아래 코드로 몽고 DB를 제어할 수 있습니다.

# 부팅시 자동 실행 등록
$ sudo systemctl enable mongod

# 몽고 DB 시작
$ sudo systemctl start mongod

# 시작되지 않는 경우
$ sudo systemctl daemon-reload

# 실행중인지 확인
$ sudo systemctl status mongod

# 중지
$ sudo systemctl stop mongod

위 제어 코드 안되는 경우 몽고DB가 제대로 설치되지 않은 것이므로 아래 코드도 실행 (MongoDB는 우분투 22.04를 정식으로 지원하지 않아 안되는 것임. 아래 방법은 권장되지 않는다고 함)

이제는 된다고 한다 ㅎㅎ… 옛날에 썻던 글이라 중간 줄만 그었다…

$ echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list
$ sudo apt-get update
$ sudo apt-get install libssl1.1
$ sudo apt install -y mongodb-org

끝!

참고링크
https://itnixpro.com/install-mongodb-on-ubuntu-22-04/
https://askubuntu.com/questions/1403619/mongodb-install-fails-on-ubuntu-22-04-depends-on-libssl1-1-but-it-is-not-insta

'Ubuntu' 카테고리의 다른 글

Nginx Let's Encrypt SSL 적용하기  (1) 2023.12.29

+ Recent posts