title: Ubuntu 14.04: Apache 2.4.7 virtualhost not working/redirecting
body: <p>I have Apache 2.4.7 installed on my Ubuntu 14.04 machine, and some of my virtualhosts are not agreeing with me. I have 5 virtual hosts I am trying to run; 3 of them work, 2 do not. The .conf files for the two that do not work are:</p>
  
  <p><strong>002-tmpnet.conf</strong></p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html/tmpnet
      ServerName  tmpnet
      &lt;Directory /&gt;
          Options FollowSymLinks
          AllowOverride All
      &lt;/Directory&gt;
      &lt;Directory /var/www/html/tmpnet/&gt;
          Options Indexes FollowSymLinks MultiViews
          AllowOverride All
          #Order allow,deny
          #allow from 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><strong>003-tmpcom.conf</strong></p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html/tmpcom
      ServerName  tmpcom
      &lt;Directory /&gt;
          Options FollowSymLinks
          AllowOverride All
      &lt;/Directory&gt;
      &lt;Directory /var/www/html/tmpcom&gt;
          Options Indexes FollowSymLinks MultiViews
          AllowOverride All
          #Order allow,deny
          #allow from 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>Both of these return </p>
  
  <pre><code>500 Internal server errors
  </code></pre>
  
  <p>when trying to visit them. If I visit them through localhost (i.e. localhost/html/tmpnet) it works perfectly fine, just not when trying to use the virtual host.</p>
  
  <p>My <strong>hosts file</strong> is:</p>
  
  <pre><code>127.0.0.1   localhost
  127.0.1.1   Eagle
  127.0.1.1   tmpcom
  127.0.1.1   tmpbiz
  127.0.1.1   tmporg
  127.0.1.1   tmpnet
  127.0.1.1   thatsmybrick
  
  # The following lines are desirable for IPv6 capable hosts
  ::1     ip6-localhost ip6-loopback
  fe00::0 ip6-localnet
  ff00::0 ip6-mcastprefix
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
  </code></pre>
  
  <p>and my <strong>apache2.conf</strong> is:</p>
  
  <pre><code>Mutex file:${APACHE_LOCK_DIR} default
  PidFile ${APACHE_PID_FILE}
  Timeout 300
  KeepAlive On
  MaxKeepAliveRequests 100
  KeepAliveTimeout 5
  
  # These need to be set in /etc/apache2/envvars
  User ${APACHE_RUN_USER}
  Group ${APACHE_RUN_GROUP}
  
  HostnameLookups on
  ErrorLog ${APACHE_LOG_DIR}/error.log
  LogLevel warn
  IncludeOptional mods-enabled/*.load
  IncludeOptional mods-enabled/*.conf
  Include ports.conf
  
  &lt;Directory /&gt;
      Options FollowSymLinks
      AllowOverride All
      Require all denied
  &lt;/Directory&gt;
  
  &lt;Directory /usr/share&gt;
      AllowOverride All
      Require all granted
  &lt;/Directory&gt;
  
  &lt;Directory /var/www/&gt;
      Options Indexes FollowSymLinks
      AllowOverride All
      Require all granted
  &lt;/Directory&gt;
  
  AccessFileName .htaccess
  
  &lt;FilesMatch "^\.ht"&gt;
      Require all denied
  &lt;/FilesMatch&gt;
  
  LogFormat "%v:%p %h %l %u %t \"%r\" %&gt;s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  LogFormat "%h %l %u %t \"%r\" %&gt;s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
  LogFormat "%h %l %u %t \"%r\" %&gt;s %O" common
  LogFormat "%{Referer}i -&gt; %U" referer
  LogFormat "%{User-agent}i" agent
  
  IncludeOptional conf-enabled/*.conf
  
  IncludeOptional sites-enabled/*.conf
  </code></pre>
  
  <p>I have been stuck on this for a long while now, and I would really appreciate some help. Any pointing in the right direction would be amazing.</p>
  
  <p>Thank you</p>