我在我的 Ubuntu 11.04 x64 笔记本电脑上全新安装了 XAMPP for Linux(版本 1.7.4)。
然后我在我的 htdocs 文件夹中创建了一个指向我的项目文件夹的链接:
$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
当我使用
http://localhost/webapp
在浏览器中打开 webapp 时,它只显示“403 Access Forbidden”。错误日志说:$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
这是httpd.conf .奇怪的是,
FollowSymLinks
选项已经定义(默认)。有一个similar question on the XAMPP forum但我认为似乎没有人关注它了。
有谁知道如何解决这个问题?
最佳答案
尝试使用您的用户运行 Apache。
默认情况下,Apache 以“www-data”运行,因此编辑您的 apache2.conf,并搜索“user”并设置:
user=youruser
重启 Apache,瞧,它应该可以工作了。
关于apache - "Symbolic link not allowed or link target not accessible"在新安装的 XAMPP for Linux 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7102544/