我只能配置一个。当我尝试配置另一个时,我收到带有错误语法的 httpd 错误。有人知道如何在 apache 中配置 2 个证书吗?这是我所拥有的:
# ssl
LoadModule ssl_module modules/mod_ssl.so
Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLPassPhraseDialog builtin
SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout 300
SSLMutex default
SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin
<VirtualHost *:443>
ServerName company ip address
ServerAlias *.company wild card certificate
DocumentRoot /live/html
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
RewriteEngine on
RewriteOptions Inherit
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
### SSLCertificateFile /etc/httpd/pki/company.co.uk.crt
### SSLCertificateKeyFile /etc/httpd/pki/server.key
### SSLCACertificateFile /etc/httpd/pki/intermediate.crt
SSLCertificateFile /etc/httpd/pki/USA/server.crt
SSLCertificateKeyFile /etc/httpd/pki/USA/server.key
SSLCACertificateFile /etc/httpd/pki/USA/intermediate.crt
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
答案1
您需要定义一个 IP/证书。每个 IP 只能使用一个证书。因此,您应该在虚拟主机中使用 IP,而不是 *:443。