Apache Config
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, 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 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 www.jonasfam.com
ServerAlias jonasfam.com *.jonasfam.com
</VirtualHost>
<VirtualHost *>
DocumentRoot /var/www/html/utahrealestateadvisor
ServerName www.utahrealestateadvisor.com
</VirtualHost>
<VirtualHost *>
DocumentRoot /var/www/html/blog
ServerName 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.
Filed under General by
Leave a Comment



I'm John and I will teach you how to outsource your business to the Philippines. When you hire someone (full-time) to do the "grunt work" in your business (for $250/month), you can focus on the things that make you money!
I have a FREE 6-part mini-course: "The Essentials For Successful Outsourcing" that will get you over the learning curve.




Comments on Apache Config
----
----
----
----
----
----
----
----
----
----
----
----
----
----