title: Why are my two apache2 virtualhosts pointing to the same directory?
body: <p>I have two virtual hosts setup on my Ubuntu 20.04 Apache2 webserver.</p>
  <p>example2.domain.com.conf</p>
  <pre><code>
  DocumentRoot /var/www/Dev
  ServerName example2.domain.com
  ServerAlias example2.domain.com
  
  &lt;Directory /var/www/Dev/&gt;
  Options FollowSymlinks
  AllowOverride All
  Require all granted
  &lt;/Directory&gt;
  
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  
  &lt;/VirtualHost&gt;
  </code></pre>
  <p>example.domain.com.conf</p>
  <pre><code>&lt;VirtualHost *:80&gt;
  
  DocumentRoot /var/www/example
  ServerName example.domain.com
  ServerAlias example.domain.com
  
  &lt;Directory /var/www/example/&gt;
  Options FollowSymlinks
  AllowOverride All
  Require all granted
  &lt;/Directory&gt;
  
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  
  Redirect permanent / https://example.domain.com/
  
  &lt;/VirtualHost&gt;
  </code></pre>
  <p>and finally: example.domain.com-le-ssl.conf</p>
  <pre><code>&lt;IfModule mod_ssl.c&gt;
  &lt;VirtualHost *:443&gt;
  
  DocumentRoot /var/www/example
  ServerName example.domain.com
  ServerAlias example.domain.com
  
  &lt;Directory /var/www/example/&gt;
  Options FollowSymlinks
  AllowOverride All
  Require all granted
  &lt;/Directory&gt;
  
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  
  
  SSLCertificateFile /etc/letsencrypt/live/example.domain.com/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/example.domain.com/privkey.pem
  Include /etc/letsencrypt/options-ssl-apache.conf
  &lt;/VirtualHost&gt;
  &lt;/IfModule&gt;
  </code></pre>
  <p>/etc/hosts</p>
  <pre><code>127.0.0.1 localhost
  127.0.0.1 example2
  </code></pre>
  <p>Ok, so when I go to example2.domain.com it shows the example2 url but displays the files from example.domain.com. example.domain.com works just fine.</p>
  <p>What gives?</p>