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 127.0.0.1] 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>
<Directory /var/www/proto-spa/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
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 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
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!
Best Answer
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
- thex
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.