I encountered this problem while setting up this website. I created 2 virtual hosts in:
kbomb Virtual Host:
CustomLog /var/log/apache2/kbomb.com.au-acce ss.log combined
phpmyadmin Virtual Host:
ErrorLog /var/log/apache2/phpmyadmin.kbomb. com.au-error.log
CustomLog /var/log/apache2/phpmyadmin.kbomb. com.au.log combined
Whenever i went to kbomb.com.au, http://www.kbomb.com.au/ or phpmyadmin.kbomb.com.au i would get the same website.
With a bit of research here is my findings...
Because my debian server has 3 static IP addresses and does routing, Apache2 doesnt know which interface the Virtual Hosts are to work on. You need to define them in /etc/apache2/apache2.conf.
If you want your Virtual Hosts working on just 1 IP Address you would want to enter:
If you would like your Virtual Hosts working on all network interfaces you want to define a wildcard. This is the most practical method unless you want to lock certain network interfaces from viewing your websites.
I wacked this line at the end of my apache2.conf file just before Include /etc/apache2/sites-enabled/.
So the end of my file looks like:
# Include the virtual host configurations:
This fixed my problem