Apache HTTP与HTTPS上的不同站点

Apache HTTP与HTTPS上的不同站点,apache,http,ssl,https,Apache,Http,Ssl,Https,我正在接管一个多站点Apache服务器,它有两个站点(a和B)。通过http访问网站A的url效果很好。转到同一个url,但使用https,显示网站B。为什么会这样,我如何转到网站A?我解决了这个问题 <VirtualHost 99.9.9.999:443> DocumentRoot /var/www/example ServerName example.com <Directory "/var/www/example"> Options

我正在接管一个多站点Apache服务器,它有两个站点(a和B)。通过http访问网站A的url效果很好。转到同一个url,但使用https,显示网站B。为什么会这样,我如何转到网站A?

我解决了这个问题

<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>
服务器设置了VirtualHost,但端口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>

DocumentRoot/var/www/example
ServerName example.com
期权指数
不允许超限
DirectoryIndex.php index.html
命令允许,拒绝
通融

在端口443上添加VirtualHost侦听,并指定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>

DocumentRoot/var/www/example
ServerName example.com
期权指数
不允许超限
DirectoryIndex.php index.html
命令允许,拒绝
通融
SSLCertificateFile/etc/httpd/conf/example.crt
SSLCertificateKeyFile/etc/httpd/conf/551; example.key
SSLCertificateChainFile/etc/httpd/conf/gd_example.crt
斯伦金安

发布服务器配置。这可能与服务器块的定义方式有关。