在我开始解释我的问题之前,值得注意的是我的DNSlogging安装正确。
这是一个奇怪的错误,我有一个服务器与IP: 82.4.165.27托pipe几个虚拟目录。 我正在使用Apache2。
我的http://test.chorkley.co.uk/url通常设置为转发到https://test.chorkley.co.uk 。 这样可行。 目前它只是加载预期的网页。
所以http://test.chorkley.co.uk/ url的预期工作,但https://test.chorkley.co.uk/不。 它不正确地加载https://home.chorkley.co.uk/ 。
出于某种原因,Apache服务器不能识别https://test.chorkley.co.uk/站点的*:443版本。
apache2ctl -S输出:
[Sat Apr 11 03:31:29.843972 2015] [core:error] [pid 11925] (EAI 2)Name or service not known: AH00547: Could not resolve host name *443 -- ignoring! VirtualHost configuration: *:443 is a NameVirtualHost default server home.chorkley.co.uk (/etc/apache2/sites-enabled/default.conf:6) port 443 namevhost home.chorkley.co.uk (/etc/apache2/sites-enabled/default.conf:6) port 443 namevhost cloud.chorkley.co.uk (/etc/apache2/sites-enabled/default.conf:20) *:80 is a NameVirtualHost default server home.chorkley.co.uk (/etc/apache2/sites-enabled/default.conf:1) port 80 namevhost home.chorkley.co.uk (/etc/apache2/sites-enabled/default.conf:1) port 80 namevhost cloud.chorkley.co.uk (/etc/apache2/sites-enabled/default.conf:15) port 80 namevhost test.chorkley.co.uk (/etc/apache2/sites-enabled/default.conf:29) port 80 namevhost vb.chorkley.co.uk (/etc/apache2/sites-enabled/default.conf:44) ServerRoot: "/etc/apache2" Main DocumentRoot: "/var/www/html" Main ErrorLog: "/var/log/apache2/error.log" Mutex default: dir="/var/lock/apache2" mechanism=fcntl Mutex mpm-accept: using_defaults Mutex watchdog-callback: using_defaults Mutex ssl-stapling: using_defaults Mutex ssl-cache: using_defaults PidFile: "/var/run/apache2/apache2.pid" Define: DUMP_VHOSTS Define: DUMP_RUN_CFG User: name="steven" id=1000 not_used Group: name="www-data" id=33 not_used
我的文件:
<VirtualHost *:80> ServerName home.chorkley.co.uk ServerAdmin [email protected] Redirect permanent / https://home.chorkley.co.uk/ </VirtualHost> <VirtualHost *:443> ServerName home.chorkley.co.uk ServerAdmin [email protected] DocumentRoot /var/www/home.chorkley.co.uk SSLCertificateFile /home/steven/.ssl/home.chorkley.co.uk.crt SSLCertificateKeyFile /home/steven/.ssl/home.chorkley.co.uk.key SSLCertificateChainFile /home/steven/.ssl/sub.class1.server.ca.pem </VirtualHost> <VirtualHost *:80> ServerName test.chorkley.co.uk ServerAdmin [email protected] DocumentRoot /var/www/test.chorkley.co.uk #Redirect permanent / https://test.chorkley.co.uk/ </VirtualHost> <VirtualHost *443> ServerName test.chorkley.co.uk ServerAdmin [email protected] DocumentRoot /var/www/test.chorkley.co.uk SSLCertificateFile /home/steven/.ssl/test.chorkley.co.uk.crt SSLCertificateKeyFile /home/steven/.ssl/test.chorkley.co.uk.key SSLCertificateChainFile /home/steven/.ssl/sub.class1.server.ca.pem </VirtualHost>
出于某种原因,Apache服务器不能识别https://test.chorkley.co.uk/站点的*:443版本。
你需要改变
<VirtualHost *443>
至:
<VirtualHost *:443>
在test.chorkley.co.uk的虚拟主机中
(注意你的configuration中缺less冒号)