I am trying to set up a simple Apache server with both standard and secure areas, using the default ports of 80 and 443. I am trying to apply a self-signed certificate, but can't seem to make Apache use it. Instead it defaults to the generic "localhost.localdomain" one.
I'm using a VirtualHost to attempt this.
Code:
NameVirtualHost *:443
<IfModule mod_ssl.c>
<VirtualHost *:443>
SSLEngine on
SSLCertificateKeyFile .cert/privkey.pem
SSLCertificateFile .cert/mycert.cert
</VirtualHost>
</IfModule>
If I remove the vhost wrapper, my site gives me
Quote:
Bad Request
Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
|
To my understanding, this just means that I've enabled SSL exclusively. However, in this case the secure site
does use mycert.cert.
Why is my cert not working on the vhost? I get no errors, and everything seems to be as expected, except for the certificate displayed.
[I can provide more configuration info if requested.]