Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 966
Petra Barus Avatar asked Aug 18 '11 04:08

Petra Barus


People also ask

How do I fix symbolic links?

The only way to fix these broken symlinks is by deleting them. Your system contains hundreds of dangling links and no one has the time to check for these links manually. In such cases, Linux tools and commands prove to be really helpful.

How do I change the owner of a symbolic link?

To change the owner of a symbolic link, use the -h option. Otherwise, the ownership of the linked file will be changed. The following image shows how symbolic links behave when -h is omitted. The owner and group of the symbolic link remain intact.

Can symbolic links be executed?

The ln command then creates the symbolic link. After you've made the symbolic link, you can perform an operation on or execute myfile , just as you could with the source_file . You can use normal file management commands (for example, cp , rm ) on the symbolic link.

How do I delete a symbolic link?

Remove a Symbolic Link using the rm command You can also use the -i flag with the rm command to prompt for confirmation. After that, you can use the ls -l command to confirm if the symlink has been removed. That is all there is to it!


1 Answers

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.

like image 104
Nilson Morais Avatar answered Oct 14 '22 18:10

Nilson Morais