Antes de começar a explicar meu problema, é importante notar que meus registros DNS estão configurados corretamente.
Esse é um erro estranho, eu tenho um servidor com o ip: 82.4.165.27
hospedando vários diretórios virtuais. Estou usando o Apache2.
Minha configuração de http://test.chorkley.co.uk/
url é geralmente para encaminhar para https://test.chorkley.co.uk
. Isso funciona. No momento, ele simplesmente carrega a página esperada.
Portanto, o http://test.chorkley.co.uk/
url funciona como esperado, mas o https://test.chorkley.co.uk/
não. Carrega incorretamente https://home.chorkley.co.uk/
.
Por algum motivo, o servidor apache não reconhece a versão *:443
do site https://test.chorkley.co.uk/
.
apache2ctl -S
Saída:
[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
Meu arquivo:
<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>