title: Set Apache to allow access for a directory not under document root
body: <p>My only virtual host in Apache has /var/www/html as its document root, that html is a symbolic link to something like /home/yanzs/web/some-project/. I am doing this so that I can easily work on a new web project without create a new virtual host in apache. So here is my problem, when I access localhost, it says </p>
  
  <pre><code>Forbidden
  
  You don't have permission to access / on this server.
  </code></pre>
  
  <p>How can I set permissions for that "/home/yanzs/web/some-project/" directory, or better its parent directory "/home/yanzs/web/"? </p>
  
  <p>Here is the default setting for /var/www/ directory, does the FollowSymLinks option automatically set permissions for directories that are the targets of symbolinks under /var/www?</p>
  
  <pre><code>&lt;Directory /var/www/&gt;
          Options Indexes FollowSymLinks
          AllowOverride None
          Require all granted
  &lt;/Directory&gt;
  </code></pre>
  
  <p><strong>Update</strong>: I also tried to use the <a href="http://httpd.apache.org/docs/2.4/en/mod/mod_alias.html#alias" rel="nofollow">Alias</a> setting, does not work either.
  <strong>Update 2</strong>: If I set the document root as /var/www/html, and create a symbolic link under html directory, pointing to /var/www/project. Then it works, and the Alias method works too.  It seems that it has something todo with the owner or other file permission settings. All files and folders under /var/www are owned by root, while those under /home/yanzs/web are owned by yanzs.</p>
  
  <p><strong>Solution:</strong></p>
  
  <p>It turns out that permission on <strong>all</strong> parent directories matters, too. One of the parent directory is copied from Windows and does not have the required permission by default. See <a href="https://wiki.apache.org/httpd/13PermissionDenied" rel="nofollow">(13) Permission Denied</a> for more details. One lesson learned is never forget to check the error logs, even if you know permissions are relevant from output of browser.</p>