일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 윈도우10
- Linux
- 리눅스
- Apache
- proxmox
- 알리익스프레스
- 알뜰폰
- 아파치
- php
- KB국민카드
- 킹북이초월
- nginx
- iptime
- 자바스크립트
- Rocky
- 복현오거리
- 보르비스초월
- OpenWrt
- SKT
- mysql
- PHP-FPM
- centos
- 램가스초월
- 가상서버호스팅
- 티스토리
- KB증권
- 스톤에이지
- 소비전력
- jQuery
- 시놀로지
- Today
- Total
맛집 여행 캠핑 일상 생활
[Rocky] docker certbot duckdns 인증서 발급 방법 본문
728x90
docker가 설치되어 있지 않다면 docker를 설치합니다.
yum config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y install docker-ce docker-ce-cli containerd.io
systemctl enable docker
systemctl start docker
docker compose version 명령어로 버전명이 잘 나오는지 확인합니다.
mkdir -p ~/docker/certbot/nginx
cd ~/docker/certbot
cat << EOF > ~/docker/certbot/nginx/certbot.conf
server {
listen 80;
server_name example.duckdns.org;
location /.well-known/acme-challenge {
allow all;
root /var/www/certbot;
}
}
EOF
cat << EOF > ~/docker/certbot/docker-compose.yml
services:
nginx:
image: nginx:latest
container_name: nginx
ports:
- "80:80"
volumes:
- ./nginx:/etc/nginx/conf.d
- ./certbot/www:/var/www/certbot
certbot:
image: certbot/certbot:latest
container_name: certbot
volumes:
- /etc/letsencrypt:/etc/letsencrypt:rw
- ./certbot/logs:/var/log/letsencrypt:rw
- ./certbot/www:/var/www/certbot:rw
command: certonly --webroot -w /var/www/certbot --email 이메일주소 --no-eff-email -d example.duckdns.org --agree-tos
EOF
docker compose up
위의 코드에서 이메일주소와 example.duckdns.org 는 자신의 도메인으로 변경하고 실행하면 됩니다.
혹시 아래의 오류가 뜨면
Unable to enable DNAT rule: (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 80 -j DNAT --to-destination 172.18.0.2:80 ! -i br-c353837207ff: iptables: No chain/target/match by that name.
(exit status 1))
systemctl restart docker 재시작하고 다시 docker compose up 명령어를 실행합니다.
728x90
반응형
'LINUX' 카테고리의 다른 글
[Linux] Docker nginx with php-fpm 설치 방법 (0) | 2025.05.20 |
---|---|
[MariaDB] Errcode: 13 Permission denied (0) | 2025.04.29 |
[Linux] Apache NGINX duckdns.org certbot 인증서 발급 방법 (0) | 2025.04.29 |
[Linux] PHPExcel 대체용 PHPSpreadSheet 설치 방법 (1) | 2025.04.24 |
[Linux] CentOS 7.x 지원 종료로 인한 yum update 에러 (0) | 2025.04.11 |
Trackback : | Comments :