【发布时间】:2017-01-21 08:18:49
【问题描述】:
以下是我编辑的 ssl.conf 的副本以删除任何识别信息。
目前,我们有一个通配符 SSL 证书,以及我们计划使用此证书托管的多个子域。 Apache confirms this should be possible
现在,域 2 正在转发到 www,但我不知道为什么。为了缩小范围,我从文件中完全删除了 www 虚拟主机并重新部署。 重定向仍然发生(并且作为唯一的虚拟主机,它加载了 domain2 文件结构)
我不知道这个重定向发生在哪里。证书可能有问题吗? (我确认证书上的通用名称是*.example.com)
Listen ip-of-server:443
LoadModule ssl_module modules/mod_ssl.so
SSLPassPhraseDialog builtin
AcceptMutex flock
SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout 300
SSLMutex default
SSLRandomSeed startup /dev/urandom 256
SSLRandomSeed connect builtin
NameVirtualHost ip-of-server:443
<VirtualHost ip-of-server:443>
SSLEngine on
SSLStrictSNIVHostCheck on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLCertificateFile /etc/apache/ssl/STAR.example.com.pem
SSLCertificateKeyFile /etc/pki/tls/private/example.com.key
ServerName "domain2.example.com"
DocumentRoot "/srv/www/domain2.example.com/public_html"
CustomLog "/srv/www/domain2.example.com/logs/access.log" combined
ErrorLog "/srv/www/domain2.example.com/logs/error.log"
<Directory /var/www/html>
AllowOverride none
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost ip-of-server:443>
SSLEngine on
SSLStrictSNIVHostCheck on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLCertificateFile /etc/apache/ssl/STAR.example.com.pem
SSLCertificateKeyFile /etc/pki/tls/private/example.com.key
ServerName "www.example.com"
DocumentRoot "/srv/www/www.example.com/public_html"
CustomLog "/srv/www/www.example.com/logs/access.log" combined
ErrorLog "/srv/www/www.example.com/logs/error.log"
<Directory /var/www/html>
AllowOverride none
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
【问题讨论】:
-
NameVirtualHost已被弃用:devdocs.io/apache_http_server/mod/core#namevirtualhost -
是的,我以前读过。我把它留在了一个绝望的希望中,也许我在一个需要它的旧版本的 apache 上。
-
你可以做到
sudo apachectl -V(或-v,以适用于版本为准) -
在 domain2 中没有重定向或重写,因此在另一个虚拟主机中触摸任何东西都是徒劳的。删除您的浏览器缓存,或尝试
curl -I https://domain2.example.com并确保它是您的服务器回复而不是其他东西,如果有重定向,请尝试从重定向来自的标头中识别,但显然它不是在什么我们在配置中看到。 -
山姆会怎么做?
标签: apache ssl virtualhost httpd.conf