当我打电话给https://new.sample.com时,我得到https://sample.com的页面,但http://new.sample.com正在获取正确的页面
sample.comconfiguration文件
<VirtualHost xx.xx.xx.xx:80> ServerName sample.com WSGIScriptAlias / /path/to/my/project/sample.wsgi </VirtualHost> <VirtualHost xx.xx.xx.xx:443> ServerName www.sample.com SSLEngine ON SSLCertificateFile /etc/apache2/ssl/mycerficate.crt SSLCertificateKeyFile /etc/apache2/ssl/mykey.key SSLCertificateChainFile /etc/apache2/ssl/mychain.crt # Django settings WSGIScriptAlias / /path/to/my/project/wsgi.py <Directory /path/to/my/project/> Options -Indexes AllowOverride All Order allow,deny Allow from all </Directory>
new.sample.comconfiguration文件
<VirtualHost xx.xx.xx.xx:80> ServerName new.sample.com ServerAlias new.sample.com WSGIPassAuthorization On # Django settings WSGIScriptAlias / /path/to/my/project/wsgi_new.py </VirtualHost>
目前,只有一个虚拟主机被configuration为请求到端口443.如果某个特定Hostname:不存在虚拟主机,则Apache会使用为该特定IP地址/端口号组合configuration的第一个虚拟主机响应HTTP请求。
您需要为在端口443上侦听的new.sample.com主机名创build虚拟主机configuration:
<VirtualHost xx.xx.xx.xx:443> ServerName new.sample.com SSLEngine On ... WSGIPassAuthorization On WSGIScriptAlias / /path/to/my/project/wsgi_new.py </VirtualHost>