Tyco22
April 30th, 2008, 08:18 PM
So for the last few days I have been pulling my hair out trying to solve this.
I have had a headless server running for about two weeks now and its all dandy. My domain is working great and there are no major issues.
Then I tried adding another domain name to the server.... No matter what I try (I have reconfiged apache about a billion times) I can not get the second domain to work. It just keeps redirecting to the first virtual host that I added.
Here is my vhost setup (domains changes for privacy):
NameVirtualHost *
<VirtualHost *>
DocumentRoot /var/www/domain1.com
ServerName www.domain1.com
</VirtualHost>
<VirtualHost *>
DocumentRoot /var/www/domain2.com
ServerName www.domain2.com
</VirtualHost>
It seems like no matter how I set them up, it always goes to whichever the first virtual host is. For instance if I move the config for domain2.com above the other, domain1.com will just redirect to domain2.com and vice versa.
If anyone can shed some light I am grateful... I cant tell you how many times I have hit up the forums and Google.
Thanks.
BTW - Ubuntu 7.10 | Apache2 | PHP5 | MySQL 5 | Webmin 1.4
I have had a headless server running for about two weeks now and its all dandy. My domain is working great and there are no major issues.
Then I tried adding another domain name to the server.... No matter what I try (I have reconfiged apache about a billion times) I can not get the second domain to work. It just keeps redirecting to the first virtual host that I added.
Here is my vhost setup (domains changes for privacy):
NameVirtualHost *
<VirtualHost *>
DocumentRoot /var/www/domain1.com
ServerName www.domain1.com
</VirtualHost>
<VirtualHost *>
DocumentRoot /var/www/domain2.com
ServerName www.domain2.com
</VirtualHost>
It seems like no matter how I set them up, it always goes to whichever the first virtual host is. For instance if I move the config for domain2.com above the other, domain1.com will just redirect to domain2.com and vice versa.
If anyone can shed some light I am grateful... I cant tell you how many times I have hit up the forums and Google.
Thanks.
BTW - Ubuntu 7.10 | Apache2 | PHP5 | MySQL 5 | Webmin 1.4