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 just been running aptitude update on my debian server via webmin when the install failed, Now my Apache2 server isn't running properly as it isn't recognizing the "namevirtualhost" directive, all the domains hosted on the server are being redirected to the default server. Luckily the other services like Postfix and Dovecot are fine.

What should I do to fix this problem?

Thanks, RayQuang

Update 1: The only errors that I receive when restarting apache are:

rayquang:~# /etc/init.d/apache2 force-reload
Reloading web server config: apache2[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:0 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:0, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:0 overlaps with VirtualHost 192.168.1.100:443, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:0, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
share|improve this question
    
Can you post the error relevant messages from your logs? –  Khaled Feb 10 '11 at 12:49
    
Do you really have a NameVirtualHost directive somewhere in the configuration? –  coredump Feb 10 '11 at 13:23

2 Answers 2

up vote 2 down vote accepted

By the looks of things that's a Debian or Ubuntu install. Edit /etc/apache2/ports.conf and replace:

NameVirtualHost *:80

with

NameVirtualHost 192.168.1.100:80

Then reload Apache. You can also use apache2ctl -S to check that your vhosts are setup correctly.

share|improve this answer

Note that OpenSuSE uses listen.conf instead of ports.conf, but the same solution works.

share|improve this answer

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.