Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question
add comment

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.

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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