Web Hosting Talk







View Full Version : help with apache and virtual servers


matt2kjones
10-30-2002, 02:19 PM
ok i got a bad problem here.

i got two domains

crystalphase.com and thedigitaldream.co.uk

the dns are correct for both domains, and the contents of the domainname.hosts files are at the bottom of this page.

here is where my problem begins though. I setup the two domains as virtual servers, which you can see in the image below

click here for screenshot (http://www.thedigitaldream.co.uk/screen.png)

now the problem is this.

if i type thedigitaldream.co.uk it will load thedigitaldream.co.uk site.

if i type www.thedigitaldream.co.uk it will load the thedigitaldream.co.uk which is great

now if i type crystalphase.com it will load the crystalphase.com site. if i type www.crystalphase.com it will load the thedigitaldream.co.uk site. why is that.

now then the weird thing is, if i swap the domains around, so that crystalphase.com is the first firtual server, not thedigitaldream.co.uk

then this happens :

if i type thedigitaldream.co.uk it will go to the thedigitaldream.co.uk site. if i type www.thedigitaldream.co.uk it will go to the crystalphase.com site. why?

now if i type crystalphase.com it will go to the crystalphase.com site, and if i type www.crystalphase.com it will go to the crystalphase.com site.

what is wrong, what could be causing this.

the dns for both domains are below :

thedigitaldream.co.uk.hosts
$ttl 38400
thedigitaldream.co.uk. IN SOA srv1.thedigitaldream.co.uk. admin.thedigitaldream.co.uk. (
2002102802
4000
3600
604800
38400 )
thedigitaldream.co.uk. IN NS srv1.thedigitaldream.co.uk.
thedigitaldream.co.uk. IN A 81.97.225.82
srv1. IN NS 81.97.225.82
www IN A 81.97.225.82
bec IN A 81.97.225.82
ftp IN A 81.97.225.82
mail IN A 81.97.225.82
xaos IN A 81.97.225.82
temptation IN A 81.97.225.82
lobuster IN A 81.97.225.82
thedigitaldream.co.uk. IN MX 10 mail.thedigitaldream.co.uk.


crystalphase.com.hosts:
$ttl 38400
crystalphase.com. IN SOA srv1.thedigitaldream.co.uk. admin.crystalphase.com. (
2002102702
4000
3600
604800
38400 )
crystalphase.com. IN NS srv1.thedigitaldream.co.uk.
crystalphase.com. IN A 81.97.225.82
srv1. IN NS 81.97.225.82
www IN A 81.97.225.82
mail IN A 81.97.225.82
profile IN A 81.97.225.82
crystalphase.com. IN MX 10 mail.crystalphase.com.

both have my primary name server registered at my registrar as :

srv1.thedigitaldream.co.uk 81.97.225.82

i dont have a secound name server so my registrar put in a secound name server and disabled it

so if anyone can help that would be great. Thanx

ho247
10-30-2002, 02:27 PM
This is quite simple, read below...

now if i type crystalphase.com it will load the crystalphase.com site. if i type www.crystalphase.com it will load the thedigitaldream.co.uk site. why is that.Go into the virtual host config screen for crystalphase.com, then go into "Networking and Addresses", in the "Alternate virtual server names" text box you need to enter www.crystalphase.com (if you're adding more, just put them one per line). Restart Apache and it'll work.

I've just read the next part of your post. But if you do the above for the thedigitaldream.co.uk domain name, then it'll work fine for whichever host you set as the default virtual host. The default virtual host is only used for domains that are not listed in your virtual host list so it goes to the default site and also for people who just type in your IP address, that will also go to the default site.

Alan

x222943
10-30-2002, 02:29 PM
you beat me

matt2kjones
10-30-2002, 03:36 PM
Hi thank you both so much for your help

i did that and it works perfectly

been trying for days to get it to work, and i just thought i must have set up something wrong

thanx again for your help

really greatful

Matthew Jones

ho247
10-30-2002, 03:39 PM
No problem, glad that it's working for you now.

Alan