Virtual Shared IPv4 not applied to Apache2 Virtualhost directive

HI Team,

I work at Lajungle Design, and we use Virtualmin 3.80Pro. Webmin version 1.520 Virtualmin version 3.80 Pro on Ubuntu 10.04LTS

Our last issue was when trying to upgrade from previous Virtualmin (3.7x Pro) to 3.8Pro and it was resolved by installing a package the support made available for us instead of automatic update.

We though everything was fine, but in fact it seems we have a small but annoying issue.

When we create a virtualserver and we select the Virtual IP he should get. Apache conf file are created without this IP on it. Thus Apache wont redirect the navigator to the website directory. Instead it will redirect to the first entry it has on its list for this IP.

let say I have domainA running on shared IP : AA.BB.CC.DD as it was previously configured it works.

now I setup domainB on the same shared IP AA.BB.CC.DD this is domainA website which is served to navigator.

but if I modify the apache domainB config file to add the IP from to

and restart apache, it works.

Any idea why virtualmin was right until the upgrade to 3.8 and doesnt do that right now :( Want do I have to check for you to help me ?

Thanks for your time. Johann



It almost sounds like Apache isn't being restarted after virtualmin adds a domain.

If you just restart Apache manually, does this also fix the problem?

No, if I restart apache2 manually it does not change anything.

The domain config file only show < virtualhost *:80 > ... ... < /virtuahost >

where it should show (as for older domain) < virtualhost my-virtual-ip-here:80 > ... ... < /virtualhost >

if I change the config file manually, then restart apache2 it works.

But it does not, if I just create the domain using virtualmin and just restart apache2

Ok, the issue might be that your Apache config has a NameVirtualHost directive that is wrong.

Does it help if you edit /etc/apache2/apache2.conf and add the line :

NameVirtualHost *:80

I did not have this line in the apache2.conf file but had them into the port.conf file.

I changed it to set it up in the apache2.conf then remove the IP from < virtualhost > directive in the /etc/apache2/site-enabled/ file. then restart apache2

and I still have the issue that is going to the default website regarding the IP I set in DNS.

and the IP need to be setup inside the file, to get my browser inside the right directory.

But as I said it before everything was fine BEFORE we upgrade to 3.8Pro all my domains (around 50) have theyr IP inside the virtualhost directive in the apache2 file.

That's why I guess it is a bug :(

If you like, we could login to your system and see what is going wrong ..

If that is possible, you could either send login details to , or grant remote support access from within Virtualmin.

So what NameVirtualHost directives exist in your Apache configuration? You can find them with the command :

grep NameVirtualHost /etc/apache2/* /etc/apache2/*/*

Also, is the IP Virtualmin is putting into the <virtualhost> block the same as the IP address of the eth0 network interface on your system?

I currently have

root@xxxxx:/etc/apache2# grep -r NameVirtualHost *

apache2.conf:NameVirtualHost *:80
apache2.conf:NameVirtualHost 91.121.A.B:80
apache2.conf:NameVirtualHost 91.121.C.D:80
apache2.conf:NameVirtualHost 91.121.C.E:80
apache2.conf:NameVirtualHost 91.121.C.F:80
apache2.conf:NameVirtualHost 91.121.C.G:80
apache2.conf.dpkg-old:NameVirtualHost 91.121.C.D:80
apache2.conf.dpkg-old:NameVirtualHost 91.121.A.B:80

ports.conf: # If you add NameVirtualHost *:443 here, you will also have to change

ports.conf.dpkg-old:#NameVirtualHost *:80
ports.conf.dpkg-old: # NameVirtualHost statement here

91.121.A.B is the main IP on eth0
others are virtual IP on eth0:1 eth0:2 ...

Previously created domaine got the correct IP on theyr config file
whether it is the real IP, or the virtual one.

But newly created just got
< virtualhost *:80 >
in there config file

and I have to change it to make it work

You might want to try removing the NameVirtualHost *:80 line , as it seems to overlap with your other NameVirtualHost lines that are on specific IPs.