I know this question gets asked a lot but none of the answers have solved my problem. I have the same configuration on my work computer but it's not working at home!

First I pulled from my git repository into ~/proto-spa. Then I installed apache2. I disabled the default site, and then I copied the /etc/apache2/sites-available/default verbatim and dumped it into /etc/apache2/sites-available/proto-spa. I changed it to point to /var/www/proto-spa. I changed directories to var/www and symlinked to my local copy with ln -s ~/proto-spa. Then I restarted apache2.

I keep getting a 403. My apache log says:

[Thu Apr 26 08:53:02 2012] [error] [client] Symbolic link not allowed or link target not accessible: /var/www/proto-spa

I followed advice on various posts, including chmod -R 755 ~/proto-spa, etc, but nothing works.

Ok, this is the part where you ask to see my configuration.

<VirtualHost *:80>
  ServerAdmin webmaster@localhost

  DocumentRoot /var/www/proto-spa
  <Directory />
    Options FollowSymLinks
    AllowOverride None
  <Directory /var/www/proto-spa/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all

  ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  <Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all

  ErrorLog ${APACHE_LOG_DIR}/error.log

  # Possible values include: debug, info, notice, warn, error, crit,
  # alert, emerg.
  LogLevel warn

  CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from ::1/128


And here's the part where you ask to see permissions:

sam@sam-central:~$ ls -l /var/www/proto-spa
lrwxrwxrwx 1 root root 20 2012-04-26 08:34 /var/www/proto-spa -> /home/sam/proto-spa/
sam@sam-central:~$ ls -l ~/proto-spa/
total 44
drwxr-xr-x 3 sam sam 4096 2012-04-26 08:32 css
-rwxr-xr-x 1 sam sam  838 2012-04-26 08:32 folders.html
-rwxr-xr-x 1 sam sam  139 2012-04-26 08:32 index.html
drwxr-xr-x 2 sam sam 4096 2012-04-26 08:32 js
-rwxr-xr-x 1 sam sam  608 2012-04-26 08:32 styles.css

Let me know if any other information would be useful, and thanks in advance for your help!


Permissions of the symlink target are good to have, but they're not the whole picture.

The Apache user needs traverse rights into the directory - which I'm willing to bet that it doesn't have.

Check the permissions on the directories /home/sam and /home/sam/proto-spa - the x bit needs to be present for traversal.

Also - what OS are you on? SELinux or AppArmor may be biting you.

And is there any reason that you actually need to use that symlink into the home directory? You shouldn't be storing web content in there.

| improve this answer | |
  • Thanks for your reply. My /home/sam directory does not have the x bit set, so good call. And no, I don't have to symlink to something within my home directory. I wasn't aware of any security concern since this is just for local development and I'm behind a firewall, etc. But I suppose it makes sense not to mess with permissions in my home folder. So I'll try all that out. Thanks again! – Samo Apr 26 '12 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.