出于某种原因,SSL在主域www.domainname.com / domainname.com上正常运行 但它不适用于子域名(我得到“此连接不受信任”) 以下是我经历的步骤:
创建了服务器证书
openssl req -new -newkey rsa:2048 -nodes -keyout domainname.key -out domainname.csr
在域名上输入* .domainname
将证书内容复制到SSL证书供应商
DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
ServerName domainname.com
ServerAlias *.domainname.com
ServerAdmin admin@domainname.com
ErrorLog "/opt/bitnami/apache2/logs/https_error_log"
TransferLog "/opt/bitnami/apache2/logs/https_access_log"
SSLEngine on
SSLCertificateFile "/opt/bitnami/apache2/conf/domainname.com.crt"
SSLCertificateKeyFile "/opt/bitnami/apache2/conf/domainname.key"
SSLCertificateChainFile "/opt/bitnami/apache2/conf/gd_bundle.crt"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/opt/bitnami/apache2/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog "/opt/bitnami/apache2/logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
ServerName domainname.com
ServerAlias *.domainname.com
ServerAdmin admin@domainname.com
ErrorLog "/opt/bitnami/apache2/logs/https_error_log"
TransferLog "/opt/bitnami/apache2/logs/https_access_log"
SSLEngine on
SSLCertificateFile "/opt/bitnami/apache2/conf/domainname.com.crt"
SSLCertificateKeyFile "/opt/bitnami/apache2/conf/domainname.key"
SSLCertificateChainFile "/opt/bitnami/apache2/conf/gd_bundle.crt"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/opt/bitnami/apache2/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog "/opt/bitnami/apache2/logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>