3

I have a number of virtual hosts in my apache installation. I have two IP adresses that I use, one for SSL only.

My default virtual host is like this:

NameVirtualHost *
<VirtualHost *:80>
...
</VirtualHost>

Problem is that I have another vhost that looks likt this and should match SSL on the other IP only:

<VirtualHost 94.75.193.86:443>
...
</VirtualHost>

When I go to http://host:443 I get the default virtual host instead of the SSL virtual host. I guess this is because I use "NameVirtualHost *" instead of specifying a port.

What I am puzzled about is that when I change the default NameVirtualHost to *:80 every other virtualhost (non-ssl) stops working and every request is sent to the default vhost.

What have I done wrong?

2

You need to look at your ssl.conf (or equivalent) file.

When you do a /usr/sbin/apachctl graceful after making your config changes, I bet it says something to the efect that your VirtualHost is conflicting with the default SSL handler.

2
  • 1
    Got lots of these: [Sun Oct 25 13:36:46 2009] [error] VirtualHost :80 -- mixing * ports and non- ports with a NameVirtualHost address is not supported, proceeding with undefined results
    – phidah
    Oct 25 '09 at 12:37
  • ahh. Right - you can have one or the other, not both. I hadn't seen that first time through your config.
    – warren
    Oct 26 '09 at 3:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.