2

I have multiple websites on my Windows Server 2003 vps, running apache2 via xampp. I am using openssl.

When I only had SSL enabled on the 1 site (I have 2 active), everything worked fine - but now I am having problems.

I cannot access https://liamwli.co.uk (or the non-secure variant), as google chrome gives an error when I try to access it:

SSL connection error Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have. Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.

I can access my other site (techmastersforum.co.uk), but it provides a very stripped down site. When I try to access techmastersforum.co.uk through https, it gives me a certificate error, as it is trying to use the certificate for my other domain.

The contents of my httpd-vhosts.conf file is:

NameVirtualHost *:80
    <VirtualHost *:80>
        ServerAdmin liam@liamwli.co.uk
        DocumentRoot "C:/xampp/xampp/htdocs"
        ServerName techmastersforum.co.uk
        ServerAlias www.techmastersforum.co.uk
        ErrorLog "logs/dummy-host.localhost-error.log"
        CustomLog "logs/dummy-host.localhost-access.log" combined
    </VirtualHost>
    <VirtualHost *:443>
        ServerAdmin liam@liamwli.co.uk
        DocumentRoot "C:\xampp\xampp\blog"
        ServerName liamwli.co.uk
        ServerAlias www.liamwli.co.uk
        ErrorLog "logs/liamwlissl.log"
        CustomLog "logs/liamwlissl.log" combined
        SSLEngine On
        SSLCertificateFile "C:\xampp\xampp\certs\www_liamwli_co_uk.crt"
        SSLCertificateKeyFile "C:\xampp\xampp\certs\www_liamwli_co_uk.key"
        SSLCACertificateFile "C:\xampp\xampp\certs\GeoTrust_CA_Bundle.crt"
    </VirtualHost>

    <VirtualHost *:443>
        ServerAdmin liam@liamwli.co.uk
        DocumentRoot "C:\xampp\xampp\htdocs"
        ServerName techmastersforum.co.uk
        ServerAlias www.techmastersforum.co.uk
        ErrorLog "logs/tmfssl.log"
        CustomLog "logs/tmfssl.log" combined
        SSLEngine On
        SSLCertificateFile "C:\xampp\xampp\certs\www_techmastersforum_co_uk.crt"
        SSLCertificateKeyFile "C:\xampp\xampp\certs\www_techmastersforum_co_uk.key"
        SSLCACertificateFile "C:\xampp\xampp\certs\GeoTrust_CA_Bundle.crt"
    </VirtualHost>

    <VirtualHost *:80>
        ServerAdmin liam@liamwli.co.uk
        DocumentRoot "C:\xampp\xampp\blog"
        ServerName liamwli.co.uk
        ServerAlias www.liamwli.co.uk
        ErrorLog "logs/dummy-host.localhost-error.log"
        CustomLog "logs/dummy-host.localhost-access.log" combined
    </VirtualHost>

Does anyone know what the problem I am having is?

As I said, I am running Apache2 via XAMPP on a Windows Server 2003 VPS.

Liam W
  • 173
  • 1
  • 1
  • 9

2 Answers2

2

As explained in this answer, you cannot use 2 different certificates for the same endpoint (ipaddress:port).

If you have 2 static IP addresses, assign a HTTPS vhost to each, like this:

<VirtualHost 1.1.1.1:443>
    ServerAdmin liam@liamwli.co.uk
    DocumentRoot "C:\xampp\xampp\blog"
    ServerName liamwli.co.uk
    ServerAlias www.liamwli.co.uk
    ErrorLog "logs/liamwlissl.log"
    CustomLog "logs/liamwlissl.log" combined
    SSLEngine On
    SSLCertificateFile "C:\xampp\xampp\certs\www_liamwli_co_uk.crt"
    SSLCertificateKeyFile "C:\xampp\xampp\certs\www_liamwli_co_uk.key"
    SSLCACertificateFile "C:\xampp\xampp\certs\GeoTrust_CA_Bundle.crt"
</VirtualHost>

<VirtualHost 2.2.2.2:443>
    ServerAdmin liam@liamwli.co.uk
    DocumentRoot "C:\xampp\xampp\htdocs"
    ServerName techmastersforum.co.uk
    ServerAlias www.techmastersforum.co.uk
    ErrorLog "logs/tmfssl.log"
    CustomLog "logs/tmfssl.log" combined
    SSLEngine On
    SSLCertificateFile "C:\xampp\xampp\certs\www_techmastersforum_co_uk.crt"
    SSLCertificateKeyFile "C:\xampp\xampp\certs\www_techmastersforum_co_uk.key"
    SSLCACertificateFile "C:\xampp\xampp\certs\GeoTrust_CA_Bundle.crt"
</VirtualHost>
Mathias R. Jessen
  • 24,907
  • 4
  • 62
  • 95
2

I had this problem. I did manage to fix it though. I would recommend you use the httpd.exe -t option to check for syntax errors.

You should provide a NameVirtualHost *:443 directive above the ssl inserts. I have provided a fixed httpd-vhosts.conf file.

NameVirtualHost *:80
    <VirtualHost *:80>
        ServerAdmin liam@liamwli.co.uk
        DocumentRoot "C:/xampp/xampp/htdocs"
        ServerName techmastersforum.co.uk
        ServerAlias www.techmastersforum.co.uk
        ErrorLog "logs/dummy-host.localhost-error.log"
        CustomLog "logs/dummy-host.localhost-access.log" combined
    </VirtualHost>

    <VirtualHost *:80>
        ServerAdmin liam@liamwli.co.uk
        DocumentRoot "C:\xampp\xampp\blog"
        ServerName liamwli.co.uk
        ServerAlias www.liamwli.co.uk
        ErrorLog "logs/dummy-host.localhost-error.log"
        CustomLog "logs/dummy-host.localhost-access.log" combined
    </VirtualHost>

NameVirtualHost *:443

<VirtualHost *:443>
        ServerAdmin liam@liamwli.co.uk
        DocumentRoot "C:\xampp\xampp\blog"
        ServerName liamwli.co.uk
        ServerAlias www.liamwli.co.uk
        ErrorLog "logs/liamwlissl.log"
        CustomLog "logs/liamwlissl.log" combined
        SSLEngine On
        SSLCertificateFile "C:\xampp\xampp\certs\www_liamwli_co_uk.crt"
        SSLCertificateKeyFile "C:\xampp\xampp\certs\www_liamwli_co_uk.key"
        SSLCACertificateFile "C:\xampp\xampp\certs\GeoTrust_CA_Bundle.crt"
    </VirtualHost>

    <VirtualHost *:443>
        ServerAdmin liam@liamwli.co.uk
        DocumentRoot "C:\xampp\xampp\htdocs"
        ServerName techmastersforum.co.uk
        ServerAlias www.techmastersforum.co.uk
        ErrorLog "logs/tmfssl.log"
        CustomLog "logs/tmfssl.log" combined
        SSLEngine On
        SSLCertificateFile "C:\xampp\xampp\certs\www_techmastersforum_co_uk.crt"
        SSLCertificateKeyFile "C:\xampp\xampp\certs\www_techmastersforum_co_uk.key"
        SSLCACertificateFile "C:\xampp\xampp\certs\GeoTrust_CA_Bundle.crt"
    </VirtualHost>
Liam W
  • 173
  • 1
  • 1
  • 9