Apache将不会跟随符号连接(403禁止) [英] Apache won't follow symlinks (403 Forbidden)

查看:169
本文介绍了Apache将不会跟随符号连接(403禁止)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些麻烦Ubuntu上设置Apache。我一直在关注本指南

I'm having some trouble setting up Apache on Ubuntu. I've been following this guide.

# /usr/sbin/apache2 -v
Server version: Apache/2.2.17 (Ubuntu)
Server built:   Feb 22 2011 18:33:02

我的公共目录,在/ var / WWW,可以成功地服务了和执行都放在它PHP页面。不过,我想创建在/ var / WWW的一个符号链接指向的目录在我的主文件夹,服务页面出现。

My public directory, /var/www, can successfully serve up and execute PHP pages that are placed in it. However, I want to create a symlink in /var/www that points to a directory in my home folder and serve pages there.

[root /var/www]# ll
total 36
drwxr-xr-x  3 root root 4096 2011-09-11 14:22 .
drwxr-xr-x 14 root root 4096 2011-06-04 22:49 ..
lrwxrwxrwx  1 root root   16 2011-09-11 13:21 about -> /root/site/about

当我试图访问/关于浏览器,我得到

When I try to access /about on browser, I get

Forbidden

You don't have permission to access /about on this server.

据我所知,我给了足够的权限来我要提供的文件:

As far as I know, I gave sufficient privileges to the files I want to serve:

[root ~/site/about]# ll
total 24
drwxr-xr-x 5 root root 4096 2011-09-11 13:20 .
drwxr--r-- 3 root root 4096 2011-09-11 13:19 ..
drwxr-xr-x 2 root root 4096 2011-09-11 13:21 contact
-rwxr-xr-x 1 root root 1090 2011-09-11 13:19 index.php
drwxr-xr-x 2 root root 4096 2011-09-11 13:20 me
drwxr-xr-x 2 root root 4096 2011-09-11 13:21 resume

我知道了FollowSymLinks的选择,我相信这是/ 000-默认文件我的/ etc / apache2的/启用站点设置:

I'm aware of the FollowSymLinks option, and I believe it's set in my /etc/apache2/sites-enabled/000-default file:

DocumentRoot /var/www
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /var/www/>
    Options FollowSymLinks Indexes MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

任何想法,我可能会错过?

Any idea what I could be missing?

推荐答案

检查Apache在执行了 /根 /根/网站的权利 /根/网站/约

Check that Apache has execute rights for /root, /root/site and /root/site/about.

运行:

chmod o+x /root /root/site /root/site/about

这篇关于Apache将不会跟随符号连接(403禁止)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆