Having Problems With Apache 2 And Multiple Virtual Hosts
I've recently installed Mandrake Linux 9.2 with Apache 2.0.47 and I'm really struggling with setting up virtual hosts in Apache. I set them up successfully using Red Hat 8 and a previous version of Apache, but I just can't seem to get it to work at all this time around.
OK, so the basic situation is that I want to use two virtual hosts. I'm using a dynamic DNS provider, so I'm almost positive that DNS isn't the problem, and I know that it's resolving my IP because connecting to my Linux machine isn't a problem. The pertinent information from my httpd2.conf file is below (I've removed the tags around the directives and I've also replaced any "." with "," because the forum won't let me post a URL unless I have 5 posts)
NameVirtualHost *:80
VirtualHost *
ServerAdmin me@myemail,com
DocumentRoot /var/www/domain1,dnsprovider,com/public_html
ServerName domain1,dnsprovider,com
ServerAlias www,domain1,dnsprovider,com
CustomLog /var/www/domain1,dnsprovider,com/logs/access.log common
ErrorLog /var/www/domain1,dnsprovider,com/logs/error.log
/VirtualHost
VirtualHost *
ServerAdmin me@myemail,com
DocumentRoot /var/www/domain2,dnsprovider,com/public_html
ServerName domain2,dnsprovider,com
ServerAlias www,domain2,dnsprovider,com
CustomLog /var/www/domain2,dnsprovider,com/logs/access.log common
ErrorLog /var/www/domain2,dnsprovider,com/logs/error.log
/VirtualHost
For some reason, Apache serves the domain1 files when I try to access either site. I've been working on this for a while now and I've come across a few others that have had this problem, but no one seems to be able to provide a solution. I have tried every configuration I can think of to resolve this issue, but nothing seems to work at all. Depending on which combination of directives, etc. I only seem to get domain1 regardless of which site I access, get domain1 and a 400 Bad Request Error on domain2, or no page at all.
My knowledge of Linux and/or Apache is pretty limited and I'm really hoping that someone can help out here, as this issue is really driving me crazy. I've considered attempting to reinstall Apache and just start from scratch, but that always seems to be more trouble than it's worth for someone with relatively limited knowledge. So, anyone have any ideas on what's going wrong here? Any help you could give is much appreciated.
|