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

Petra Barus picture Petra Barus · Aug 18, 2011 · Viewed 16.2k times · Source

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?

Answer

Nilson Morais picture Nilson Morais · Aug 7, 2012

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.