title: Virtual Hosts on Ubuntu 10.04. -Access Forbidden Error 403
body: <p>Operating System: Ubuntu 10.04 LTS</p>
  
  <p>
  Downloaded and installed Xampp for linux 1.8.1 in /opt</p>
  
  <p>When I go to localhost I get the standard xampp start page, everyting works, except phpmyadmin which I fixed by adding the "Required all Granted" line to extra/httpd-xampp.conf</p>
  
  <pre><code># since XAMPP 1.4.3
  &lt;Directory "/opt/lampp/phpmyadmin"&gt;
      AllowOverride AuthConfig Limit
      Order allow,Deny
      Allow from all
  #cahg 
      Require all granted
  &lt;/Directory&gt;
  </code></pre>
  
  <p>I want to develop multiple sites so I have set up Virtual hosts using what I think is the standard method. </p>
  
  <ol>
  <li>Include extra/httpd-vhosts.conf in my httpd.conf file</li>
  <li><p>In the extra/httpd-vhosts.conf file added a virtual host container.
  3.Add the following to /etc/hosts file </p>
  
  <p>127.0.1.1       site1</p></li>
  </ol>
  
  <p>I must have done this first part right because it is working but I am getting the following error in my web browser when I navigate to 'site 1'</p>
  
  <pre><code>    Access forbidden!
  
  You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
  
  If you think this is a server error, please contact the webmaster.
  
  Error 403
  
  site1
  Apache/2.4.3 (Unix) OpenSSL/1.0.1c PHP/5.4.7
  </code></pre>
  
  <p>and this error in my ErrorLog</p>
  
  <pre><code>[Fri Nov 16 17:14:22.481075 2012] [core:error] [pid 14465] (13)Permission denied: [client 127.0.1.1:46687] AH00035: access to / denied (filesystem path '/home/andrew/websites/site1') because search permissions are missing on a component of the path
  </code></pre>
  
  <p>The solution I have tried is adding this Directory block to my httpd-vhosts.conf file in directory tags with /home/andrew/websites/site as and attribute.</p>
  
  <pre><code>Options Indexes FollowSymLinks ExecCGI Includes
  AllowOverride All
  Require all granted
  </code></pre>
  
  <p>Without fully understanding what it does because it was a solution I found and in httpd.conf it states <code>"You must explicitly permit access to web content directories in other &lt;Directory&gt; blocks below."</code></p>
  
  <p>My Question is: What is the best way to allow apache to access the files for my various virtual hosts?
  Note: in httpd.conf user is nobody and group is set to nogroup. </p>