我在哪里设置 FollowSymLinks?

Que*_*ner 5 apache-httpd

我刚刚在新的 Linux Mint 安装上设置了一个 Apache 2.2 服务器。我正在重新创建以前在旧 Ubuntu 机器上的设置。

在我以前的计算机上,我必须启用FollowSymLinksin httpd.conf,因为我将我的网站 HTML 文件存储在我的主目录中,并从/var/www.

在我的新服务器上,我找不到任何httpd.conf地方,所以我似乎无法设置跟随符号链接的选项。结果,我收到了一个403 Forbidden: You don't have permission to access / on this server错误。

另外,在我的错误日志中,它说:

[Sun May 05 02:12:17 2013] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/Websites
Run Code Online (Sandbox Code Playgroud)

允许符号链接的方式有什么改变吗?还是我的设置有误httpd.conf?无论如何,如何让我的新 Apache 遵循符号链接?


更新:根据下面的答案,我检查了文件/etc/apache2/sites-enabled/000-default/etc/apache2/sites-available/default,它们都有FollowSymLinks选项。我可能会收到上述错误,还有其他原因吗?

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

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)

Ant*_*hon 2

您应该查看/etc/apache2/sites-enabled/000-default(这可能是 的链接/etc/apache2/sites-available/default)。