title: httpd.conf - Setting up a second "localhost" to a different localpath
body: <p>I'm using XAMPP on my Windows 7 computer when doing web projects. In my <code>httpd.conf</code> file, <code>DocumentRoot</code> is set up simple, like this:</p>
  
  <pre><code>DocumentRoot "D:/Users/Thinkpad/DropBox/MAMP"
  &lt;Directory "D:/Users/Thinkpad/DropBox/MAMP"&gt;
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Require all granted
  &lt;/Directory&gt;
  </code></pre>
  
  <p>This location is used for work projects, and now I want a separate location just like this one, for private projects. Just have it to point to a different localpath, <code>D:/Users/Thinkpad/DropBox/Web</code>, and preferrably name it something other than localhost. Something like <code>private</code> or something. So my URL will end up looking like this <code>http://private/mywebproject</code></p>
  
  <p>I've tried looking at documentation for this, but I can't get it to work. Do I need to edit my hosts file for it to work? And what else needs to be set in <code>httpd.conf</code> file?</p>
  
  <p>Edit: So here's the final solution from the <code>httpd-vhosts</code> file</p>
  
  <pre><code>&lt;VirtualHost private:80&gt;
      DocumentRoot "D:/Users/Thinkpad/Dropbox/Web"
      ServerName private
      ErrorLog "logs/dropbox.local-error.log"
      CustomLog "logs/dropbox.local-access.log" combined
      &lt;Directory "D:/Users/Thinkpad/Dropbox/Web"&gt;
          AllowOverride All
          Order Allow,Deny
          Allow from all
          Require all granted
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost localhost:80&gt;
      DocumentRoot "D:/Users/Thinkpad/Dropbox/MAMP"
      ServerName private
      ErrorLog "logs/dropbox.local-error.log"
      CustomLog "logs/dropbox.local-access.log" combined
      &lt;Directory "D:/Users/Thinkpad/Dropbox/MAMP"&gt;
          AllowOverride All
          Order Allow,Deny
          Allow from all
          Require all granted
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I had to add the regular localhost as well, even though it was already defined in httpd.conf file. </p>
  
  <p>Also, hosts-file needed to have these two lines:</p>
  
  <pre><code>127.0.0.1           localhost
  127.0.0.1       private
  </code></pre>