After doing much googleing, and much reading of how to set up virtual hosts in apache, I finally figured it out. The documentation on this is very poor. All I wanted to do was set up apache to handle multiple domains, and to be able to handle *.domain.com and point it to a certain location. I want to be able to have domain.com, http://www.domain.com, something.domain.com, and *.domain.com all point to different places. Here’s what I came up with, and after consulting with others, this seems to be correct. I’ve also tried it and have it working on familylearn’s box too.

<VirtualHost *>
DocumentRoot /var/www/html
ServerName http://www.bagunsa.com
</VirtualHost>

<VirtualHost *>
DocumentRoot /var/www/html/post_nuke
ServerName jonas.bagunsa.com
</VirtualHost>

<VirtualHost *>
DocumentRoot /var/www/html/test
ServerName bagunsa.com
ServerAlias *.bagunsa.com
</VirtualHost>

<VirtualHost *>
DocumentRoot /var/www/html/post_nuke
ServerName http://www.jonasfam.com
ServerAlias jonasfam.com *.jonasfam.com
</VirtualHost>

<VirtualHost *>
DocumentRoot /var/www/html/utahrealestateadvisor
ServerName http://www.utahrealestateadvisor.com
</VirtualHost>

<VirtualHost *>
DocumentRoot /var/www/html/blog
ServerName http://www.jonasblog.com
ServerAlias jonasblog.com *.jonasblog.com
</VirtualHost>

I learned that you have to put all of your specific entries for a domain first, then you put the catchall last. The ServerName also can’t have any wildcards in it, as they should go into the ServerAlias field.