Confused about https://

In the default apache22 configuration, if you include httpd-ssl.conf it adds
Code:
<VirtualHost _default_:443>
DocumentRoot "/usr/local/www/apache22/data"
...
which is the "It works" page...

If you want the same vhost on both port 80 (http) and 443 (https) you need to copy it and add a couple of lines:
Code:
<VirtualHost *:80>
....
</VirtualHost>

<VirtualHost *:443>
...
    SSLEngine on
    SSLCertificateFile "/usr/local/etc/apache22/server.crt"
    SSLCertificateKeyFile "/usr/local/etc/apache22/server.key"
</VirtualHost>

This works perfectly for me!


EDIT:
If you're at not using virtual hosts, you at least have to point it to the same document root!

EDIT:
By convention, you should always use example.com for examples... http://en.wikipedia.org/wiki/Example.com :)
 
Back
Top