저는 centos 8을 사용하고 있으며 기본(루트) 도메인에서는 작동하지 않지만 하위 도메인에서는 작동하는 Let's Encrypt 인증서를 설치했습니다. 루트 및 하위 도메인 모두에 사용 가능한 인증서를 확인했습니다. 다음 인증서를 찾았습니다.
Certificate Name: teachersbook.pk
Serial Number: XXXXXXXXXXXXXX
Key Type: XXXXXXXX
Domains: teachersbook.pk www.teachersbook.pk
Expiry Date: 2021-12-13 06:54:33+00:00 (VALID: 89 days)
Certificate Path: /etc/letsencrypt/live/teachersbook.pk/fullchain.pem
Private Key Path: /etc/letsencrypt/live/teachersbook.pk/privkey.pem
내 VHost 구성은
<VirtualHost *:80>
ServerName teachersbook.pk
ServerAlias www.teachersbook.pk
ServerAdmin [email protected]
DocumentRoot /var/www/teachersbook.pk/
ErrorLog /var/log/httpd/teachersbook.pk-error.log
CustomLog /var/log/httpd/teachersbook.pk-access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =teachersbook.pk [OR]
RewriteCond %{SERVER_NAME} =www.teachersbook.pk
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
내 Let's Encrypt SSL 파일 구성은 다음과 같습니다.
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName teachersbook.pk
ServerAlias www.teachersbook.pk
ServerAdmin [email protected]
DocumentRoot /var/www/teachersbook.pk/
ErrorLog /var/log/httpd/teachersbook.pk-error.log
CustomLog /var/log/httpd/teachersbook.pk-access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/teachersbook.pk/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/teachersbook.pk/privkey.pem
</VirtualHost>
</IfModule>