Apache multiple domains setup Apache multiple domains setup apache apache

Apache multiple domains setup


Ok, I figured it out. It was pretty silly. I just needed to uncomment this line so I would actually use all the virtual hosts:

NameVirtualHost *:80


You need to set up the two domains in two separate virtual hosts. Generally when I do this I like to split off an include directory full of virtual host files, with each file containing one virtual host.

<VirtualHost *:80>  ServerName site1.com  DocumentRoot "/var/www/site1"</VirtualHost><VirtualHost *:80>  ServerName site2.com  DocumentRoot "/var/www/site2"</VirtualHost>