I have multiple sites all setup the same as below except "bk" has something else in it's place...

NameVirtualHost *:80

<VirtualHost bk:80>
  ServerName bk
  DocumentRoot /var/www/bk.com/
</VirtualHost>

and I get these errors when restarting apache:

[Mon Jan 17 10:28:56 2011] [error] VirtualHost bk:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Jan 17 10:28:56 2011] [warn] NameVirtualHost bk:80 has no VirtualHosts

I don't get it... the other 2 sites I have virtual host configurations for this exact same way don't throw any errors

update

One error message fixed - here's where I'm at now..

<VirtualHost bk:80>
  ServerName bk
  DocumentRoot /var/www/bk.com/
</VirtualHost>

[Mon Jan 17 10:28:56 2011] [error] VirtualHost bk:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
link|improve this question

feedback

1 Answer

up vote 2 down vote accepted

NameVirtualHost directive usually should be used only once in server config, an usually it looks like "NameVirtualHost *:80", which means "serve virtualhosts on all available IP addresses". In most cases, you don't care about IP address on which request was accepted as long as it contains "Host:" field.

link|improve this answer
That took care of the "has no virtual hosts" error, but I still get the other thing about mixing ports – Webnet Jan 17 '11 at 15:45
1  
<VirtualHost> directives should take exactly the same argument that was specified in "NameVirtualHost" directive. – gelraen Jan 17 '11 at 15:57
I've made that adjustment and it got rid of the error, thanks. When I access http://bk/ it throws PHP errors for another site, not the one specified in this virtual host... any ideas why that is? This virtual host only contains HTML, no PHP – Webnet Jan 17 '11 at 16:03
Can you show all your virtualhosts? – gelraen Jan 17 '11 at 16:09
feedback

Your Answer

 
or
required, but never shown

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