"Symbolic link not allowed or link target not accessible" on fresh installed XAMPP for Linux
Asked Answered
P

3

13

I did a fresh-install of XAMPP for Linux (version 1.7.4) on my Ubuntu 11.04 x64 laptop. Then I made a link in my htdocs folder to my project folder:

$pwd
/opt/lampp/htdocs
$sudo ln -s /home/petra/projects/webapp webapp
$ls -al
drwxr-xr-x  4 nobody root 4096 2011-08-18 11:58 .
drwxr-xr-x 18 root   root 4096 2011-01-25 15:33 ..
lrwxrwxrwx  1 root   root   26 2011-08-18 11:42 webapp -> /home/petra/projects/webapp

When I opened the webapp in the browser using http://localhost/webapp, it only showed "403 Access Forbidden". The error log said:

$tail -f /opt/lampp/logs/error_log
[Thu Aug 18 11:43:15 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /opt/lampp/htdocs/webapp

Here is the httpd.conf. Strangely, the FollowSymLinks options are already defined (default).

There is a similar question on the XAMPP forum but I think nobody seems to pay attention to it anymore.

Does anyone have an idea how to fix this?

Patriliny answered 18/8, 2011 at 4:52 Comment(2)
You don't have a .htaccess file in /opt/lampp/htdocs that disables FollowSymLinks?Transit
there is no .htaccess file in the /opt/lampp/htdocsPatriliny
H
7

Try to run Apache using your user.

By default Apache runs as "www-data" so edit your apache2.conf, and search for "user" and set:

user=youruser

Restart Apache and voilà, it should work.

Hemidemisemiquaver answered 7/8, 2012 at 20:13 Comment(2)
What a strange solution, I'd suggested the exact opposit : turn ownership of your files to apache.Encroach
@Petra Barus can you unflag this answer as the solution? This solution is not helpful, since the apache running as www-data is not a problem.Soundless
P
5

I found out that if I use link from directory outside /home/petra, the web-app is working normally. I guess it's because I use Encrypted Home Directory setting on my Ubuntu.

I just have to move the project directory outside my home directory to make it work.

Patriliny answered 18/8, 2011 at 12:54 Comment(1)
Maybe it has something to do with a SELinux policy. If it's the case, you should see related warnings/errors in /var/log/messagesEncroach
P
0

I ran into this problem when I symlinked the document root to code sitting on my encrypted home directory. I also solved it by running apache as the user who owned the encrypted content.

Paregmenon answered 13/4, 2014 at 3:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.