我目前在配置 MAMP 2 以将 SSL 与多个虚拟主机一起使用时遇到了麻烦(它与一个虚拟主机一起工作正常)。就我而言,它只会为 https-ssl.conf 文件中列出的第一个虚拟主机提供 SSL 连接。
在我的 httpd-vhosts.conf 文件中,我有几个虚拟主机设置,例如:
<VirtualHost *:80>
DocumentRoot "/Users/me/sites/something/"
ServerName something.local
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/me/sites/else/"
ServerName else.local
</VirtualHost>
在我的 https-ssl.conf 文件中,我有几个虚拟主机设置,例如:
<VirtualHost *:443>
DocumentRoot "/Users/me/sites/something"
ServerName something.local:443
ServerAdmin you@example.com
ErrorLog "/Applications/MAMP/Library/logs/error_log"
TransferLog "/Applications/MAMP/Library/logs/access_log"
SSLEngine on
# SSL Cipher Suite:
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
# Server Certificate:
SSLCertificateFile "/Applications/MAMP/conf/apache/server.crt"
#SSLCertificateFile "/Applications/MAMP/conf/apache/server-dsa.crt"
# Server Private Key:
SSLCertificateKeyFile "/Applications/MAMP/conf/apache/server.key"
#SSLCertificateKeyFile "/Applications/MAMP/conf/apache/server-dsa.key"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/Applications/MAMP/Library/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
# SSL Protocol Adjustments:
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# Per-Server Logging:
CustomLog "/Applications/MAMP/Library/logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "/Users/me/sites/else"
ServerName else.local:443
ServerAdmin you@example.com
ErrorLog "/Applications/MAMP/Library/logs/error_log"
TransferLog "/Applications/MAMP/Library/logs/access_log"
........add'l config deleted......
</VirtualHost>
在 https-ssl.conf 中列出的第一个虚拟主机提供 SSL 支持,但在它之后没有列出任何虚拟主机( https://something.local 可以工作,但不是https://else.local)总是有效
任何帮助,将不胜感激!