title: Virtual host shows directory structure
body: <blockquote>
    <p><strong>Goal</strong> :- set up virtual host correctly.</p>
  </blockquote>
  
  <p>currently I am working on MAC system version 10.10.05 os x yosemite.</p>
  
  <p>I have configured apache2,php and mysql using <a href="https://www.apachefriends.org/index.html" rel="nofollow noreferrer">XAMPP</a> </p>
  
  <p>I have follow <a href="https://coolestguidesontheplanet.com/set-virtual-hosts-apache-mac-osx-10-9-mavericks-osx-10-8-mountain-lion/" rel="nofollow noreferrer">all the necessary steps</a> for configuring virtual host.</p>
  
  <p>my file <strong>/private/etc/apache2/extra/httpd-vhosts.conf</strong> would be like </p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName localhost
      DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
      &lt;Directory "/Applications/XAMPP/xamppfiles/htdocs"&gt;
          Options Indexes FollowSymLinks Includes execCGI
          AllowOverride All
          Require all granted
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80&gt;
      ServerName emsv2l.localhost.com
      ServerAlias emsv2l.localhost.com
      DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/emsv2"
      ErrorLog "/private/var/log/apache2/apple.com-error_log"
      CustomLog "/private/var/log/apache2/apple.com-access_log" common
      ServerAdmin webmaster@dev.plutustec.com
          &lt;Directory "/Applications/XAMPP/xamppfiles/htdocs/emsv2"&gt;
                  Options Indexes FollowSymLinks Includes ExecCGI
                  AllowOverride All
                  Require all granted
          &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80&gt;
      ServerName emsv2l-backend.plutustec.com
      ServerAlias emsv2l-backend.plutustec.com
      DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/emsv2-backend/public“
      ErrorLog "/private/var/log/apache2/apple.com-error_log"
      CustomLog "/private/var/log/apache2/apple.com-access_log" common
      ServerAdmin webmaster@dev.plutustec.com
          &lt;Directory "/Applications/XAMPP/xamppfiles/htdocs/emsv2-backend/public“&gt;
                  Options Indexes FollowSymLinks Includes ExecCGI
                  AllowOverride All
                  Require all granted
          &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>So, Now if i write <code>http://emsv2l.localhost.com/</code> would be redirect to project instead it's showing directory structure.</p>
  
  <p><a href="https://i.stack.imgur.com/707EF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/707EF.png" alt="enter image description here"></a></p>
  
  <p>my <code>/etc/hosts</code> file would be like</p>
  
  <pre><code>##
  # Host Database
  #
  # localhost is used to configure the loopback interface
  # when the system is booting.  Do not change this entry.
  ##
  #127.0.0.1      localhost
  #255.255.255.255        broadcasthost
  #::1             localhost
  #127.0.0.1      dev.local
  #127.0.0.1     emsv2l-backend.plutustec.com             # emsv2-backend
  #127.0.0.1     emsv2l.plutustec.com             # emsv2
  #127.0.0.1      plutustec.com #localplutus site
  127.0.0.1 emsv2l.localhost.com
  127.0.0.1 emsv2l-backend.plutustec.com
  </code></pre>
  
  <p>Any help would be appreciated. </p>