I am setting up several sites on an ubuntu 14 server with apache2. I copied 000-default.conf and created a site1.conf. Then I changed some settings, reloaded apache2, and now almost everything works. Except that my default document in the DirectoryIndex setting is not being honored. My site1.conf looks similar to this:
<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName site1.com DocumentRoot /var/www/site1 ServerAlias *.site1.com DirectoryIndex one.php </VirtualHost>
But my problem is that visiting http://site1.com/ still shows index.html instead of one.php which I want it to show. Be aware that once I get this working I want to setup site2.com and have it use the default document of two.php.
I'm guessing that DirectoryIndex is a setting that doesn't work inside VirtualHost and instead is a global setting in apache2.conf. I searched for this stuff and can't find a good explanation or way to do it.