
我剛剛在新安裝的 Linux Mint 上設定了 Apache 2.2 伺服器。我正在舊的 Ubuntu 機器上重新建立先前的設定。
在我以前的電腦上,我必須啟用FollowSymLinks
in 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
允許符號連結的方式是否改變了?或者我對設定的理解有誤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>
答案1
您應該查看/etc/apache2/sites-enabled/000-default
(這可能是 的連結/etc/apache2/sites-available/default
)。