apache - HTTP 与 HTTPS 的不同站点

标签 apache http ssl https

我正在接管一个多站点 Apache 服务器,它有两个网站(A 和 B)。通过 http 访问网站 A 的 url 可以正常工作。转到相同的 url,但使用 https,显示网站 B。这是为什么,我如何制作 https://urlA.com去网站A?

最佳答案

我解决了这个问题。

服务器设置了 VirtualHosts,但是端口 443 没有 VirtualHost。所以它看起来像这样:

<VirtualHost 99.9.9.999:80>
DocumentRoot /var/www/example
ServerName example.com

    <Directory "/var/www/example">
            Options Indexes
            AllowOverride None
            DirectoryIndex index.php index.html
            Order allow,deny
            Allow from all
    </Directory>

添加一个 VirtualHost 监听端口 443,并指定 SSLCertFiles 解决了这个问题。

<VirtualHost 99.9.9.999:443>
DocumentRoot /var/www/example
ServerName example.com

    <Directory "/var/www/example">
            Options Indexes
            AllowOverride None
            DirectoryIndex index.php index.html
            Order allow,deny
            Allow from all
    </Directory>

SSLCertificateFile /etc/httpd/conf/example.crt
SSLCertificateKeyFile /etc/httpd/conf/_.example.key
SSLCertificateChainFile /etc/httpd/conf/gd_example.crt
SSLEngine on

</VirtualHost>

关于apache - HTTP 与 HTTPS 的不同站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44375123/

相关文章:

java - 在大型 Java 应用程序中,有没有办法确保只使用 TLSv1.2 或更高版本?

java ssl 多客户端证书

来自 Google 文档的 wget 上的 SSL 证书错误

php - 避免用户去../../

Apache 2.4 ssl.conf 之一的虚拟主机加载了错误的证书

internet-explorer - 后重定向-使用 Internet Explorer 获取

java - Resttemplate在接收响应之前如何确定响应的状态码?

spring - 如何在混合的 Apache 和 Tomcat 环境中保持 session

linux - SVN checkout 失败,svn ://protocol but it is working with svn+ssh://protocol

java - HttpURLConnection 发布 Android