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?
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.
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.
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.
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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With