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.

Hello and sorry if this is a duplicate, just couldn't find the answer... So i own domainA.com and domainB.com (from Godaddy). I forward both to my static ip. Web server is apache 2.2.23 with local ip of 192.168.2.5. I have 2 virtual hosts :

NameVirtualHost 192.168.2.5

<VirtualHost 192.168.2.5:80>
DocumentRoot "C:/webroot/domainA"
ServerName domainA.com
ServerAlias www.domainA.com         
</VirtualHost>

<VirtualHost 192.168.2.5:80>
DocumentRoot "C:/webroot/domainB"
ServerName domainB.com
ServerAlias www.domainB.com         
</VirtualHost>

For some reason, if i visit domainB.com, domainA.com takes over. I edited each CNAME for www:

domainA.com : www -> domainA.com
domainB.com : www -> domainB.com

But I'm not too sure about this part....

share|improve this question

1 Answer 1

Ok figured it out. I had to add NameVirtualHost and remove the www -> domainA.com and use @ instead.

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.