Tôi có chứng chỉ ký tự đại diện ssl (letsencrypt) chẳng hạn.de & *.example.com.
000-default.conf của tôi trông giống như:
<VirtualHost *:80>
ServerName example.de
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
Redirect permanent / https://example.de/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName cloud.example.de
ServerAdmin info@example.de
DocumentRoot /var/www/cloud.example.de
Redirect permanent / https://cloud.example.de/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName dev.example.de
ServerAdmin info@example.de
DocumentRoot /var/www/dev.example.de
Redirect permanent / https://dev.example.de/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
mặc định-ssl.conf:
<IfModule mod_ssl.c>
<Máy chủ ảo *:443>
ServerName example.de
Công cụ SSL Bật
SSLCertificateFile /etc/letsencrypt/live/example.de/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.de/privkey.pem
Tài liệuRoot /var/www/html
Nhật ký lỗi ${APACHE_LOG_DIR}/error.log
Nhật ký tùy chỉnh ${APACHE_LOG_DIR}/access.log kết hợp
</Máy chủ ảo>
<Máy chủ ảo _default_:443>
Quản trị viên web ServerAdmin@localhost
Tài liệuRoot /var/www/html
Nhật ký lỗi ${APACHE_LOG_DIR}/error.log
Nhật ký tùy chỉnh ${APACHE_LOG_DIR}/access.log kết hợp
Công cụ SSL bật
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Thư mục /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Thư mục>
</Máy chủ ảo>
</IfModule>
dev.example.de & cloud.example.de có chứng chỉ ssl ký tự đại diện và chuyển hướng cả hai vào thư mục html??
nhập mô tả hình ảnh ở đây
Điều tương tự xảy ra khi tôi sử dụng cái này:
nhập mô tả hình ảnh ở đây