I have played with a number of different configurations and just cannot get this worked out. I guess I would be happy to implement a way for apache to serve up nothing if the match is not perfect. But just to get it to serve one default port 80 page would be great.
Basically I have:
listen 80
listen 443
listen 888
namevirtualhosts 192.168.0.1:80
<virtualhost 192.168.0.1:80>
servername mydomain.com
</virtual host>
<virtualhost 192.168.0.1:80>
servername anotherdomain.com
</virtualhost>
<virtualhost 192.168.0.1:80>
servername webmail.anotherdomain.com
</virtual host>
<virtualhost 192.168.0.1:443>
servername webmail.mydomain.com
SSLEngine on
</virtualhost>
<virtualhost 192.168.0.1:888>
servername database.mydomain.com
SSLEngine on
</virtual host>
Basically apache is picking the closest match for each http and https. So if I enter
http://webmail.mydomain.com it serves mydomain.com which is the firs http in the list. It is making the request on port 80.
If I enter
https://mydomain.com it serves webmail.mydomain.com. There has to be a way to handle people not entering the correct protocol.
I would be happy with a catch everything but a perfect match where I could redirect or something.
I appreciate any ideas.
Tom