티스토리 뷰
반응형
🔐 Ubuntu에서 SSL 인증서 설정 방법
✅ 1. 인증서 준비
SSL 인증서에는 보통 세 가지 파일이 필요합니다:
- certificate.crt 또는 your_domain.pem (인증서 파일)
- private.key (비공개 키)
- ca_bundle.crt 또는 중간 인증서 (필요한 경우)
👉 Let’s Encrypt를 사용하는 경우 자동으로 발급 및 갱신 가능. 아래에서 설명합니다.
📁 Apache에서 SSL 설정
1. SSL 모듈 활성화
sudo a2enmod ssl
2. SSL 설정 파일 수정
sudo nano /etc/apache2/sites-available/your_domain.conf
예시:
<VirtualHost *:443>
ServerName yourdomain.com
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /etc/ssl/certs/your_domain.crt
SSLCertificateKeyFile /etc/ssl/private/your_domain.key
SSLCertificateChainFile /etc/ssl/certs/ca_bundle.crt
</VirtualHost>
3. 사이트 활성화 및 Apache 재시작
sudo a2ensite your_domain.conf
sudo systemctl restart apache2
🌐 Nginx에서 SSL 설정
1. SSL 설정 추가
sudo nano /etc/nginx/sites-available/your_domain
예시:
server {
listen 443 ssl;
server_name yourdomain.com;
ssl_certificate /etc/ssl/certs/your_domain.crt;
ssl_certificate_key /etc/ssl/private/your_domain.key;
ssl_trusted_certificate /etc/ssl/certs/ca_bundle.crt;
location / {
root /var/www/html;
index index.html;
}
}
2. 설정 적용
sudo ln -s /etc/nginx/sites-available/your_domain /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
🔄 Let’s Encrypt로 무료 SSL 설정 (자동 갱신 포함)
1. Certbot 설치
sudo apt update
sudo apt install certbot python3-certbot-nginx # 또는 python3-certbot-apache
2. 인증서 발급
# Nginx의 경우
sudo certbot --nginx
# Apache의 경우
sudo certbot --apache
3. 자동 갱신 테스트
sudo certbot renew --dry-run
🔎 확인 방법
- 브라우저에서 https://yourdomain.com 접속
- openssl 명령어로 확인:
openssl s_client -connect yourdomain.com:443
반응형
'이것저것' 카테고리의 다른 글
Kubernetes (0) | 2025.06.04 |
---|---|
Docker 명령어 (0) | 2025.06.04 |
wsl2 ubuntu + nginx + php8.3 + mysql8 설치 (0) | 2025.05.29 |
ps 프로세스 관리 (0) | 2025.05.29 |
OOP 개발 (0) | 2025.05.23 |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 비동기
- reflectionclass
- call_user_func
- flask
- #collect
- uniqid
- ubuntu
- laravel 12
- 명령어
- eloquent
- strict_types
- WSL2
- mysql
- ob_get_contents
- swagger
- php
- researcher
- 설정
- 설치
- facades
- curl_multi_init
- privatechannel
- laravel 테스트
- laravel 11
- wsl
- PYTHON
- array_combine
- createfromformat
- jp:a
- Laravel
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함